Theory AOT_PLM

1(*<*)
2theory AOT_PLM
3  imports AOT_Axioms
4begin
5(*>*)
6
7section‹The Deductive System PLM›
8
9(* constrain sledgehammer to the abstraction layer *)
10unbundle AOT_no_atp
11
12AOT_theorem "modus-ponens": assumes φ and φ  ψ shows ψ
13  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
14lemmas MP = "modus-ponens"
15
16AOT_theorem "non-con-thm-thm": assumes  φ shows  φ
17  using assms by simp
18
19AOT_theorem "vdash-properties:1[1]": assumes φ  Λ shows  φ
20  using assms unfolding AOT_model_act_axiom_def by blast (* NOTE: semantics needed *)
21
22text‹Convenience attribute for instantiating modally-fragile axioms.›
23attribute_setup act_axiom_inst =
24  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[1]"})))
25  "Instantiate modally fragile axiom as modally fragile theorem."
26
27AOT_theorem "vdash-properties:1[2]": assumes φ  Λ shows  φ
28  using assms unfolding AOT_model_axiom_def by blast (* NOTE: semantics needed *)
29
30text‹Convenience attribute for instantiating modally-strict axioms.›
31attribute_setup axiom_inst =
32  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[2]"})))
33  "Instantiate axiom as theorem."
34
35text‹Convenience methods and theorem sets for applying "cqt:2".›
36method cqt_2_lambda_inst_prover = (fast intro: AOT_instance_of_cqt_2_intro)
37method "cqt:2[lambda]" = (rule "cqt:2[lambda]"[axiom_inst]; cqt_2_lambda_inst_prover)
38lemmas "cqt:2" = "cqt:2[const_var]"[axiom_inst] "cqt:2[lambda]"[axiom_inst] AOT_instance_of_cqt_2_intro
39method "cqt:2" = (safe intro!: "cqt:2")
40
41AOT_theorem "vdash-properties:3": assumes  φ shows Γ  φ
42  using assms by blast
43
44AOT_theorem "vdash-properties:5": assumes Γ1  φ and Γ2  φ  ψ shows Γ1, Γ2  ψ
45  using MP assms by blast
46
47AOT_theorem "vdash-properties:6": assumes φ and φ  ψ shows ψ
48  using MP assms by blast
49
50AOT_theorem "vdash-properties:8": assumes Γ  φ and φ  ψ shows Γ  ψ
51  using assms by argo
52
53AOT_theorem "vdash-properties:9": assumes φ shows ψ  φ
54  using MP "pl:1"[axiom_inst] assms by blast
55
56AOT_theorem "vdash-properties:10": assumes φ  ψ and φ shows ψ
57  using MP assms by blast
58lemmas "→E" = "vdash-properties:10"
59
60AOT_theorem "rule-gen": assumes for arbitrary α: φ{α} shows α φ{α}
61  using assms by (metis AOT_var_of_term_inverse AOT_sem_denotes AOT_sem_forall) (* NOTE: semantics needed *)
62lemmas GEN = "rule-gen"
63
64AOT_theorem "RN[prem]": assumes Γ  φ shows Γ  φ
65  by (meson AOT_sem_box assms image_iff) (* NOTE: semantics needed *)
66AOT_theorem RN: assumes  φ shows φ
67  using "RN[prem]" assms by blast
68
69AOT_axiom "df-rules-formulas[1]": assumes φ df ψ shows φ  ψ
70  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
71AOT_axiom "df-rules-formulas[2]": assumes φ df ψ shows ψ  φ
72  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
73(* NOTE: for convenience also state the above as regular theorems *)
74AOT_theorem "df-rules-formulas[3]": assumes φ df ψ shows φ  ψ
75  using "df-rules-formulas[1]"[axiom_inst, OF assms].
76AOT_theorem "df-rules-formulas[4]": assumes φ df ψ shows ψ  φ
77  using "df-rules-formulas[2]"[axiom_inst, OF assms].
78
79
80AOT_axiom "df-rules-terms[1]":
81  assumes τ{α1...αn} =df σ{α1...αn}
82  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
83  using assms by (simp add: AOT_model_axiomI AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
84AOT_axiom "df-rules-terms[2]":
85  assumes τ =df σ
86  shows (σ  τ = σ) & (¬σ  ¬τ)
87  by (metis "df-rules-terms[1]" case_unit_Unity assms)
88(* NOTE: for convenience also state the above as regular theorems *)
89AOT_theorem "df-rules-terms[3]":
90  assumes τ{α1...αn} =df σ{α1...αn}
91  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
92  using "df-rules-terms[1]"[axiom_inst, OF assms].
93AOT_theorem "df-rules-terms[4]":
94  assumes τ =df σ
95  shows (σ  τ = σ) & (¬σ  ¬τ)
96  using "df-rules-terms[2]"[axiom_inst, OF assms].
97
98
99AOT_theorem "if-p-then-p": φ  φ
100  by (meson "pl:1"[axiom_inst] "pl:2"[axiom_inst] MP)
101
102AOT_theorem "deduction-theorem": assumes φ  ψ shows φ  ψ
103  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
104lemmas CP = "deduction-theorem"
105lemmas "→I" = "deduction-theorem"
106
107AOT_theorem "ded-thm-cor:1": assumes Γ1  φ  ψ and Γ2  ψ  χ shows Γ1, Γ2  φ  χ
108  using "→E" "→I" assms by blast
109AOT_theorem "ded-thm-cor:2": assumes Γ1  φ  (ψ  χ) and Γ2  ψ shows Γ1, Γ2  φ  χ
110  using "→E" "→I" assms by blast
111
112AOT_theorem "ded-thm-cor:3": assumes φ  ψ and ψ  χ shows φ  χ
113  using "→E" "→I" assms by blast
114declare "ded-thm-cor:3"[trans]
115AOT_theorem "ded-thm-cor:4": assumes φ  (ψ  χ) and ψ shows φ  χ
116  using "→E" "→I" assms by blast
117
118lemmas "Hypothetical Syllogism" = "ded-thm-cor:3"
119
120AOT_theorem "useful-tautologies:1": ¬¬φ  φ
121  by (metis "pl:3"[axiom_inst] "→I" "Hypothetical Syllogism")
122AOT_theorem "useful-tautologies:2": φ  ¬¬φ
123  by (metis "pl:3"[axiom_inst] "→I" "ded-thm-cor:4")
124AOT_theorem "useful-tautologies:3": ¬φ  (φ  ψ)
125  by (meson "ded-thm-cor:4" "pl:3"[axiom_inst] "→I")
126AOT_theorem "useful-tautologies:4": (¬ψ  ¬φ)  (φ  ψ)
127  by (meson "pl:3"[axiom_inst] "Hypothetical Syllogism" "→I")
128AOT_theorem "useful-tautologies:5": (φ  ψ)  (¬ψ  ¬φ)
129  by (metis "useful-tautologies:4" "Hypothetical Syllogism" "→I")
130
131AOT_theorem "useful-tautologies:6": (φ  ¬ψ)  (ψ  ¬φ)
132  by (metis "→I" MP "useful-tautologies:4")
133
134AOT_theorem "useful-tautologies:7": (¬φ  ψ)  (¬ψ  φ)
135  by (metis "→I" MP "useful-tautologies:3" "useful-tautologies:5")
136
137AOT_theorem "useful-tautologies:8": φ  (¬ψ  ¬(φ  ψ))
138  by (metis "→I" MP "useful-tautologies:5")
139
140AOT_theorem "useful-tautologies:9": (φ  ψ)  ((¬φ  ψ)  ψ)
141  by (metis "→I" MP "useful-tautologies:6")
142
143AOT_theorem "useful-tautologies:10": (φ  ¬ψ)  ((φ  ψ)  ¬φ)
144  by (metis "→I" MP "pl:3"[axiom_inst])
145
146AOT_theorem "dn-i-e:1": assumes φ shows ¬¬φ
147  using MP "useful-tautologies:2" assms by blast
148lemmas "¬¬I" = "dn-i-e:1"
149AOT_theorem "dn-i-e:2": assumes ¬¬φ shows φ
150  using MP "useful-tautologies:1" assms by blast
151lemmas "¬¬E" = "dn-i-e:2"
152
153AOT_theorem "modus-tollens:1": assumes φ  ψ and ¬ψ shows ¬φ
154  using MP "useful-tautologies:5" assms by blast
155AOT_theorem "modus-tollens:2": assumes φ  ¬ψ and ψ shows ¬φ
156  using "¬¬I" "modus-tollens:1" assms by blast
157lemmas MT = "modus-tollens:1" "modus-tollens:2"
158
159AOT_theorem "contraposition:1[1]": assumes φ  ψ shows ¬ψ  ¬φ
160  using "→I" MT(1) assms by blast
161AOT_theorem "contraposition:1[2]": assumes ¬ψ  ¬φ shows φ  ψ
162  using "→I" "¬¬E" MT(2) assms by blast
163
164AOT_theorem "contraposition:2": assumes φ  ¬ψ shows ψ  ¬φ
165  using "→I" MT(2) assms by blast
166
167(* TODO: this is actually a mixture of the two variants given in PLM; adjust. *)
168AOT_theorem "reductio-aa:1":
169  assumes ¬φ  ¬ψ and ¬φ  ψ shows φ
170  using "→I" "¬¬E" MT(2) assms by blast
171AOT_theorem "reductio-aa:2":
172  assumes φ  ¬ψ and φ  ψ shows ¬φ
173  using "reductio-aa:1" assms by blast
174lemmas "RAA" = "reductio-aa:1" "reductio-aa:2"
175
176AOT_theorem "exc-mid": φ  ¬φ
177  using "df-rules-formulas[4]" "if-p-then-p" MP "conventions:2" by blast
178
179AOT_theorem "non-contradiction": ¬(φ & ¬φ)
180  using "df-rules-formulas[3]" MT(2) "useful-tautologies:2" "conventions:1" by blast
181
182AOT_theorem "con-dis-taut:1": (φ & ψ)  φ
183  by (meson "→I" "df-rules-formulas[3]" MP RAA(1) "conventions:1")
184AOT_theorem "con-dis-taut:2": (φ & ψ)  ψ
185  by (metis "→I" "df-rules-formulas[3]" MT(2) RAA(2) "¬¬E" "conventions:1")
186lemmas "Conjunction Simplification" = "con-dis-taut:1" "con-dis-taut:2"
187
188AOT_theorem "con-dis-taut:3": φ  (φ  ψ)
189  by (meson "contraposition:1[2]" "df-rules-formulas[4]" MP "→I" "conventions:2")
190AOT_theorem "con-dis-taut:4": ψ  (φ  ψ)
191  using "Hypothetical Syllogism" "df-rules-formulas[4]" "pl:1"[axiom_inst] "conventions:2" by blast
192lemmas "Disjunction Addition" = "con-dis-taut:3" "con-dis-taut:4"
193
194AOT_theorem "con-dis-taut:5": φ  (ψ  (φ & ψ))
195  by (metis "contraposition:2" "Hypothetical Syllogism" "→I" "df-rules-formulas[4]" "conventions:1")
196lemmas Adjunction = "con-dis-taut:5"
197
198AOT_theorem "con-dis-taut:6": (φ & φ)  φ
199  by (metis Adjunction "→I" "df-rules-formulas[4]" MP "Conjunction Simplification"(1) "conventions:3")
200lemmas "Idempotence of &" = "con-dis-taut:6"
201
202AOT_theorem "con-dis-taut:7": (φ  φ)  φ
203proof -
204  {
205    AOT_assume φ  φ
206    AOT_hence ¬φ  φ
207      using "conventions:2"[THEN "df-rules-formulas[3]"] MP by blast
208    AOT_hence φ using "if-p-then-p" RAA(1) MP by blast
209  }
210  moreover {
211    AOT_assume φ
212    AOT_hence φ  φ using "Disjunction Addition"(1) MP by blast
213  }
214  ultimately AOT_show (φ  φ)  φ
215    using "conventions:3"[THEN "df-rules-formulas[4]"] MP
216    by (metis Adjunction "→I")
217qed
218lemmas "Idempotence of ∨" = "con-dis-taut:7"
219
220
221AOT_theorem "con-dis-i-e:1": assumes φ and ψ shows φ & ψ
222  using Adjunction MP assms by blast
223lemmas "&I" = "con-dis-i-e:1"
224
225AOT_theorem "con-dis-i-e:2:a": assumes φ & ψ shows φ
226  using "Conjunction Simplification"(1) MP assms by blast
227AOT_theorem "con-dis-i-e:2:b": assumes φ & ψ shows ψ
228  using "Conjunction Simplification"(2) MP assms by blast
229lemmas "&E" = "con-dis-i-e:2:a" "con-dis-i-e:2:b"
230
231AOT_theorem "con-dis-i-e:3:a": assumes φ shows φ  ψ
232  using "Disjunction Addition"(1) MP assms by blast
233AOT_theorem "con-dis-i-e:3:b": assumes ψ shows φ  ψ
234  using "Disjunction Addition"(2) MP assms by blast
235AOT_theorem "con-dis-i-e:3:c": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
236  by (metis "con-dis-i-e:3:a" "Disjunction Addition"(2) "df-rules-formulas[3]" MT(1) RAA(1) "conventions:2" assms)
237lemmas "∨I" = "con-dis-i-e:3:a" "con-dis-i-e:3:b" "con-dis-i-e:3:c"
238
239AOT_theorem "con-dis-i-e:4:a": assumes φ  ψ and φ  χ and ψ  χ shows χ
240  by (metis MP RAA(2) "df-rules-formulas[3]" "conventions:2" assms)
241AOT_theorem "con-dis-i-e:4:b": assumes φ  ψ and ¬φ shows ψ
242  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
243AOT_theorem "con-dis-i-e:4:c": assumes φ  ψ and ¬ψ shows φ
244  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
245lemmas "∨E" = "con-dis-i-e:4:a" "con-dis-i-e:4:b" "con-dis-i-e:4:c"
246
247AOT_theorem "raa-cor:1": assumes ¬φ  ψ & ¬ψ shows φ
248  using "&E" "∨E"(3) "∨I"(2) RAA(2) assms by blast
249AOT_theorem "raa-cor:2": assumes φ  ψ & ¬ψ shows ¬φ
250  using "raa-cor:1" assms by blast
251AOT_theorem "raa-cor:3": assumes φ and ¬ψ  ¬φ shows ψ
252  using RAA assms by blast
253AOT_theorem "raa-cor:4": assumes ¬φ and ¬ψ  φ shows ψ
254  using RAA assms by blast
255AOT_theorem "raa-cor:5": assumes φ and ψ  ¬φ shows ¬ψ
256  using RAA assms by blast
257AOT_theorem "raa-cor:6": assumes ¬φ and ψ  φ shows ¬ψ
258  using RAA assms by blast
259
260(* TODO: note these need manual introduction rules *)
261AOT_theorem "oth-class-taut:1:a": (φ  ψ)  ¬(φ & ¬ψ)
262  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
263     (metis "&E" "&I" "raa-cor:3" "→I" MP)
264AOT_theorem "oth-class-taut:1:b": ¬(φ  ψ)  (φ & ¬ψ)
265  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
266     (metis "&E" "&I" "raa-cor:3" "→I" MP)
267AOT_theorem "oth-class-taut:1:c": (φ  ψ)  (¬φ  ψ)
268  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
269     (metis "&I" "∨I"(1, 2) "∨E"(3) "→I" MP "raa-cor:1")
270
271AOT_theorem "oth-class-taut:2:a": (φ & ψ)  (ψ & φ)
272  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
273     (meson "&I" "&E" "→I")
274lemmas "Commutativity of &" = "oth-class-taut:2:a"
275AOT_theorem "oth-class-taut:2:b": (φ & (ψ & χ))  ((φ & ψ) & χ)
276  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
277     (metis "&I" "&E" "→I")
278lemmas "Associativity of &" = "oth-class-taut:2:b"
279AOT_theorem "oth-class-taut:2:c": (φ  ψ)  (ψ  φ)
280  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
281     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
282lemmas "Commutativity of ∨" = "oth-class-taut:2:c"
283AOT_theorem "oth-class-taut:2:d": (φ  (ψ  χ))  ((φ  ψ)  χ)
284  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
285     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
286lemmas "Associativity of ∨" = "oth-class-taut:2:d"
287AOT_theorem "oth-class-taut:2:e": (φ  ψ)  (ψ  φ)
288  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I";
289      metis "&I" "df-rules-formulas[4]" "conventions:3" "&E" "Hypothetical Syllogism" "→I" "df-rules-formulas[3]")
290lemmas "Commutativity of ≡" = "oth-class-taut:2:e"
291AOT_theorem "oth-class-taut:2:f": (φ  (ψ  χ))  ((φ  ψ)  χ)
292  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
293        "→I" "→E" "&E" "&I"
294  by metis
295lemmas "Associativity of ≡" = "oth-class-taut:2:f"
296
297AOT_theorem "oth-class-taut:3:a": φ  φ
298  using "&I" "vdash-properties:6" "if-p-then-p" "df-rules-formulas[4]" "conventions:3" by blast
299AOT_theorem "oth-class-taut:3:b": φ  ¬¬φ
300  using "&I" "useful-tautologies:1" "useful-tautologies:2" "vdash-properties:6" "df-rules-formulas[4]" "conventions:3" by blast
301AOT_theorem "oth-class-taut:3:c": ¬(φ  ¬φ)
302  by (metis "&E" "→E" RAA "df-rules-formulas[3]" "conventions:3")
303
304AOT_theorem "oth-class-taut:4:a": (φ  ψ)  ((ψ  χ)  (φ  χ))
305  by (metis "→E" "→I")
306AOT_theorem "oth-class-taut:4:b": (φ  ψ)  (¬φ  ¬ψ)
307  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
308        "→I" "→E" "&E" "&I" RAA by metis
309AOT_theorem "oth-class-taut:4:c": (φ  ψ)  ((φ  χ)  (ψ  χ))
310  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
311        "→I" "→E" "&E" "&I" by metis
312AOT_theorem "oth-class-taut:4:d": (φ  ψ)  ((χ  φ)  (χ  ψ))
313  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
314        "→I" "→E" "&E" "&I" by metis
315AOT_theorem "oth-class-taut:4:e": (φ  ψ)  ((φ & χ)  (ψ & χ))
316  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
317        "→I" "→E" "&E" "&I" by metis
318AOT_theorem "oth-class-taut:4:f": (φ  ψ)  ((χ & φ)  (χ & ψ))
319  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
320        "→I" "→E" "&E" "&I" by metis
321AOT_theorem "oth-class-taut:4:g": (φ  ψ)  ((φ & ψ)  (¬φ & ¬ψ))
322proof(safe intro!: "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"] "&I" "→I"
323           dest!: "conventions:3"[THEN "df-rules-formulas[3]", THEN "→E"])
324  AOT_show φ & ψ  (¬φ & ¬ψ) if (φ  ψ) & (ψ  φ)
325    using "&E" "∨I" "→E" "&I" "raa-cor:1" "→I" "∨E" that by metis
326next
327  AOT_show ψ if φ & ψ  (¬φ & ¬ψ) and φ
328    using that "∨E" "&E" "raa-cor:3" by blast
329next
330  AOT_show φ if φ & ψ  (¬φ & ¬ψ) and ψ
331    using that "∨E" "&E" "raa-cor:3" by blast
332qed
333AOT_theorem "oth-class-taut:4:h": ¬(φ  ψ)  ((φ & ¬ψ)  (¬φ & ψ))
334proof (safe intro!: "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"] "&I" "→I")
335  AOT_show φ & ¬ψ  (¬φ & ψ) if ¬(φ  ψ)
336    by (metis that "&I" "∨I"(1, 2) "→I" MT(1) "df-rules-formulas[4]" "raa-cor:3" "conventions:3")
337next
338  AOT_show ¬(φ  ψ) if φ & ¬ψ  (¬φ & ψ)
339    by (metis that "&E" "∨E"(2) "→E" "df-rules-formulas[3]" "raa-cor:3" "conventions:3")
340qed
341AOT_theorem "oth-class-taut:5:a": (φ & ψ)  ¬(¬φ  ¬ψ)
342  using "conventions:3"[THEN "df-rules-formulas[4]"]
343        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
344AOT_theorem "oth-class-taut:5:b": (φ  ψ)  ¬(¬φ & ¬ψ)
345  using "conventions:3"[THEN "df-rules-formulas[4]"]
346        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
347AOT_theorem "oth-class-taut:5:c": ¬(φ & ψ)  (¬φ  ¬ψ)
348  using "conventions:3"[THEN "df-rules-formulas[4]"]
349        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
350AOT_theorem "oth-class-taut:5:d": ¬(φ  ψ)  (¬φ & ¬ψ)
351  using "conventions:3"[THEN "df-rules-formulas[4]"]
352        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
353
354lemmas DeMorgan = "oth-class-taut:5:c" "oth-class-taut:5:d"
355
356AOT_theorem "oth-class-taut:6:a": (φ & (ψ  χ))  ((φ & ψ)  (φ & χ))
357  using "conventions:3"[THEN "df-rules-formulas[4]"]
358        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
359AOT_theorem "oth-class-taut:6:b": (φ  (ψ & χ))  ((φ  ψ) & (φ  χ))
360  using "conventions:3"[THEN "df-rules-formulas[4]"]
361        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
362
363AOT_theorem "oth-class-taut:7:a": ((φ & ψ)  χ)  (φ  (ψ  χ))
364  by (metis "&I" "→E" "→I")
365lemmas Exportation = "oth-class-taut:7:a"
366AOT_theorem "oth-class-taut:7:b": (φ  (ψ χ))  ((φ & ψ)  χ)
367  by (metis "&E" "→E" "→I")
368lemmas Importation = "oth-class-taut:7:b"
369
370AOT_theorem "oth-class-taut:8:a": (φ  (ψ  χ))  (ψ  (φ  χ))
371  using "conventions:3"[THEN "df-rules-formulas[4]"] "→I" "→E" "&E" "&I" by metis
372lemmas Permutation = "oth-class-taut:8:a"
373AOT_theorem "oth-class-taut:8:b": (φ  ψ)  ((φ  χ)  (φ  (ψ & χ)))
374  by (metis "&I" "→E" "→I")
375lemmas Composition = "oth-class-taut:8:b"
376AOT_theorem "oth-class-taut:8:c": (φ  χ)  ((ψ  χ)  ((φ  ψ)  χ))
377  by (metis "∨E"(2) "→E" "→I" RAA(1))
378AOT_theorem "oth-class-taut:8:d": ((φ  ψ) & (χ  Θ))  ((φ & χ)  (ψ & Θ))
379  by (metis "&E" "&I" "→E" "→I")
380lemmas "Double Composition" = "oth-class-taut:8:d"
381AOT_theorem "oth-class-taut:8:e": ((φ & ψ)  (φ & χ))  (φ  (ψ  χ))
382  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
383            "→I" "→E" "&E" "&I")
384AOT_theorem "oth-class-taut:8:f": ((φ & ψ)  (χ & ψ))  (ψ  (φ  χ))
385  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
386            "→I" "→E" "&E" "&I")
387AOT_theorem "oth-class-taut:8:g": (ψ  χ)  ((φ  ψ)  (φ  χ))
388  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
389            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
390AOT_theorem "oth-class-taut:8:h": (ψ  χ)  ((ψ  φ)  (χ  φ))
391  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
392            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
393AOT_theorem "oth-class-taut:8:i": (φ  (ψ & χ))  (ψ  (φ  χ))
394  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
395            "→I" "→E" "&E" "&I")
396
397AOT_theorem "intro-elim:1": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
398  by (metis assms "∨I"(1, 2) "∨E"(1) "conventions:3"[THEN "df-rules-formulas[3]"] "→I" "→E" "&E"(1))
399
400AOT_theorem "intro-elim:2": assumes φ  ψ and ψ  φ shows φ  ψ
401  by (meson "&I" "conventions:3" "df-rules-formulas[4]" MP assms)
402lemmas "≡I" = "intro-elim:2"
403
404AOT_theorem "intro-elim:3:a": assumes φ  ψ and φ shows ψ
405  by (metis "∨I"(1) "→I" "∨E"(1) "intro-elim:1" assms)
406AOT_theorem "intro-elim:3:b": assumes φ  ψ and ψ shows φ
407  using "intro-elim:3:a" "Commutativity of ≡" assms by blast
408AOT_theorem "intro-elim:3:c": assumes φ  ψ and ¬φ shows ¬ψ
409  using "intro-elim:3:b" "raa-cor:3" assms by blast
410AOT_theorem "intro-elim:3:d": assumes φ  ψ and ¬ψ shows ¬φ
411  using "intro-elim:3:a" "raa-cor:3" assms by blast
412AOT_theorem "intro-elim:3:e": assumes φ  ψ and ψ  χ shows φ  χ
413  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
414declare "intro-elim:3:e"[trans]
415AOT_theorem "intro-elim:3:f": assumes φ  ψ and φ  χ shows χ  ψ
416  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
417lemmas "≡E" = "intro-elim:3:a" "intro-elim:3:b" "intro-elim:3:c" "intro-elim:3:d" "intro-elim:3:e" "intro-elim:3:f"
418
419declare "Commutativity of ≡"[THEN "≡E"(1), sym]
420
421AOT_theorem "rule-eq-df:1": assumes φ df ψ shows φ  ψ
422  by (simp add: "≡I" "df-rules-formulas[3]" "df-rules-formulas[4]" assms)
423lemmas "≡Df" = "rule-eq-df:1"
424AOT_theorem "rule-eq-df:2": assumes φ df ψ and φ shows ψ
425  using "≡Df" "≡E"(1) assms by blast
426lemmas "≡dfE" = "rule-eq-df:2"
427AOT_theorem "rule-eq-df:3": assumes φ df ψ and ψ shows φ
428  using "≡Df" "≡E"(2) assms by blast
429lemmas "≡dfI" = "rule-eq-df:3"
430
431AOT_theorem  "df-simplify:1": assumes φ  (ψ & χ) and ψ shows φ  χ
432  by (metis "&E"(2) "&I" "≡E"(1, 2) "≡I" "→I" assms)
433(* TODO: this is a slight variation from PLM *)
434AOT_theorem  "df-simplify:2": assumes φ  (ψ & χ) and χ shows φ  ψ
435  by (metis "&E"(1) "&I" "≡E"(1, 2) "≡I" "→I" assms)
436lemmas "≡S" = "df-simplify:1"  "df-simplify:2"
437
438AOT_theorem "rule-ui:1": assumes α φ{α} and τ shows φ{τ}
439  using "→E" "cqt:1"[axiom_inst] assms by blast
440AOT_theorem "rule-ui:2[const_var]": assumes α φ{α} shows φ{β}
441  by (simp add: "rule-ui:1" "cqt:2[const_var]"[axiom_inst] assms)
442(* TODO: precise proviso in PLM *)
443AOT_theorem "rule-ui:2[lambda]":
444  assumes F φ{F} and INSTANCE_OF_CQT_2(ψ)
445  shows φ{ν1...νn ψ{ν1...νn}]}
446  by (simp add: "rule-ui:1" "cqt:2[lambda]"[axiom_inst] assms)
447AOT_theorem "rule-ui:3": assumes α φ{α} shows φ{α}
448  by (simp add: "rule-ui:2[const_var]" assms)
449lemmas "∀E" = "rule-ui:1" "rule-ui:2[const_var]" "rule-ui:2[lambda]" "rule-ui:3"
450
451AOT_theorem "cqt-orig:1[const_var]": α φ{α}  φ{β} by (simp add: "∀E"(2) "→I")
452AOT_theorem "cqt-orig:1[lambda]":
453  assumes INSTANCE_OF_CQT_2(ψ)
454  shows F φ{F}  φ{ν1...νn ψ{ν1...νn}]}
455  by (simp add: "∀E"(3) "→I" assms)
456AOT_theorem "cqt-orig:2": α (φ  ψ{α})  (φ  α ψ{α})
457  by (metis "→I" GEN "vdash-properties:6" "∀E"(4))
458AOT_theorem "cqt-orig:3": α φ{α}  φ{α} using "cqt-orig:1[const_var]" .
459
460(* TODO: work out difference to GEN *)
461AOT_theorem universal: assumes for arbitrary β: φ{β} shows α φ{α}
462  using GEN assms .
463lemmas "∀I" = universal
464
465(* Generalized mechanism for "∀I" followed by ∀E *)
466ML467fun get_instantiated_allI ctxt varname thm = let
468val trm = Thm.concl_of thm
469val trm = case trm of (@{const Trueprop} $ (@{const AOT_model_valid_in} $ _ $ x)) => x
470                      | _ => raise Term.TERM ("Expected simple theorem.", [trm])
471fun extractVars (Const (const_name‹AOT_term_of_var›, _) $ Var v) =
472    (if fst (fst v) = fst varname then [Var v] else []) (* TODO: care about the index? *)
473  | extractVars (t1 $ t2) = extractVars t1 @ extractVars t2
474  | extractVars (Abs (_, _, t)) = extractVars t
475  | extractVars _ = []
476val vars = extractVars trm
477val vars = fold Term.add_vars vars []
478val var = hd vars
479val trmty = case (snd var) of (Type (type_name‹AOT_var›, [t])) => (t)
480              | _ => raise Term.TYPE ("Expected variable type.", [snd var], [Var var])
481val trm = Abs (Term.string_of_vname (fst var), trmty, Term.abstract_over (
482      Const (const_name‹AOT_term_of_var›, Type ("fun", [snd var, trmty]))
483       $ Var var, trm))
484val trm = Thm.cterm_of (Context.proof_of ctxt) trm
485val ty = hd (Term.add_tvars (Thm.prop_of @{thm "∀I"}) [])
486val typ = Thm.ctyp_of (Context.proof_of ctxt) trmty
487val allthm = Drule.instantiate_normalize ([(ty, typ)],[]) @{thm "∀I"}
488val phi = hd (Term.add_vars (Thm.prop_of allthm) [])
489val allthm = Drule.instantiate_normalize ([],[(phi,trm)]) allthm
490in
491allthm
492end
493
494
495attribute_setup "∀I" =
496  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
497  (fn ctxt => fn thm => fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm))
498  "Quantify over a variable in a theorem using GEN."
499
500attribute_setup "unvarify" =
501  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
502  (fn ctxt => fn thm =>
503    let
504    val thm = fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm
505    val thm = fold (fn _ => fn thm => thm RS @{thm "∀E"(1)}) args thm
506    in
507     thm
508    end))
509  "Generalize a statement about variables to a statement about denoting terms."
510
511(* TODO: rereplace-lem does not apply to the embedding *)
512
513AOT_theorem "cqt-basic:1": αβ φ{α,β}  βα φ{α,β}
514  by (metis "≡I" "∀E"(2) "∀I" "→I")
515
516AOT_theorem "cqt-basic:2": α(φ{α}  ψ{α})  (α(φ{α}  ψ{α}) & α(ψ{α}  φ{α}))
517proof (rule "≡I"; rule "→I")
518  AOT_assume α(φ{α}  ψ{α})
519  AOT_hence φ{α}  ψ{α} for α using "∀E"(2) by blast
520  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
521    using "≡E"(1,2) "→I" by blast+
522  AOT_thus α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
523    by (auto intro: "&I" "∀I")
524next
525  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
526  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
527    using "∀E"(2) "&E" by blast+
528  AOT_hence φ{α}  ψ{α} for α
529    using "≡I" by blast
530  AOT_thus α(φ{α}  ψ{α}) by (auto intro: "∀I")
531qed
532
533AOT_theorem "cqt-basic:3": α(φ{α}  ψ{α})  (α φ{α}  α ψ{α})
534proof(rule "→I")
535  AOT_assume α(φ{α}  ψ{α})
536  AOT_hence 1: φ{α}  ψ{α} for α using "∀E"(2) by blast
537  {
538    AOT_assume α φ{α}
539    AOT_hence α ψ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
540  }
541  moreover {
542    AOT_assume α ψ{α}
543    AOT_hence α φ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
544  }
545  ultimately AOT_show α φ{α}  α ψ{α}
546    using "≡I" "→I" by auto
547qed
548
549AOT_theorem "cqt-basic:4": α(φ{α} & ψ{α})  (α φ{α} & α ψ{α})
550proof(rule "→I")
551  AOT_assume 0: α(φ{α} & ψ{α})
552  AOT_have φ{α} and ψ{α} for α using "∀E"(2) 0 "&E" by blast+
553  AOT_thus α φ{α} & α ψ{α}
554    by (auto intro: "∀I" "&I")
555qed
556
557AOT_theorem "cqt-basic:5": (α1...∀αn(φ{α1...αn}))  φ{α1...αn}
558  using "cqt-orig:3" by blast
559
560AOT_theorem "cqt-basic:6": αα φ{α}  α φ{α}
561  by (meson "≡I" "→I" GEN "cqt-orig:1[const_var]")
562
563AOT_theorem "cqt-basic:7": (φ  α ψ{α})  α(φ  ψ{α})
564  by (metis "→I" "vdash-properties:6" "rule-ui:3" "≡I" GEN)
565
566AOT_theorem "cqt-basic:8": (α φ{α}  α ψ{α})  α (φ{α}  ψ{α})
567  by (simp add: "∨I"(3) "→I" GEN "cqt-orig:1[const_var]")
568
569AOT_theorem "cqt-basic:9": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α(φ{α}  χ{α})
570proof -
571  {
572    AOT_assume α (φ{α}  ψ{α})
573    moreover AOT_assume α (ψ{α}  χ{α})
574    ultimately AOT_have φ{α}  ψ{α} and ψ{α}  χ{α} for α using "∀E" by blast+
575    AOT_hence φ{α}  χ{α} for α by (metis "→E" "→I")
576    AOT_hence α(φ{α}  χ{α}) using "∀I" by fast
577  }
578  thus ?thesis using "&I" "→I" "&E" by meson
579qed
580
581AOT_theorem "cqt-basic:10": (α(φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α (φ{α}  χ{α})
582proof(rule "→I"; rule "∀I")
583  fix β
584  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  χ{α})
585  AOT_hence φ{β}  ψ{β} and ψ{β}  χ{β} using "&E" "∀E" by blast+
586  AOT_thus φ{β}  χ{β} using "≡I" "≡E" by blast
587qed
588
589AOT_theorem "cqt-basic:11": α(φ{α}  ψ{α})  α (ψ{α}  φ{α})
590proof (rule "≡I"; rule "→I")
591  AOT_assume 0: α(φ{α}  ψ{α})
592  {
593    fix α
594    AOT_have φ{α}  ψ{α} using 0 "∀E" by blast
595    AOT_hence ψ{α}  φ{α} using "≡I" "≡E" "→I" "→E" by metis
596  }
597  AOT_thus α(ψ{α}  φ{α}) using "∀I" by fast
598next
599  AOT_assume 0: α(ψ{α}  φ{α})
600  {
601    fix α
602    AOT_have ψ{α}  φ{α} using 0 "∀E" by blast
603    AOT_hence φ{α}  ψ{α} using "≡I" "≡E" "→I" "→E" by metis
604  }
605  AOT_thus α(φ{α}  ψ{α}) using "∀I" by fast
606qed
607
608AOT_theorem "cqt-basic:12": α φ{α}  α (ψ{α}  φ{α})
609  by (simp add: "∀E"(2) "→I" GEN)
610
611AOT_theorem "cqt-basic:13": α φ{α}  β φ{β}
612  using "≡I" "→I" by blast
613
614AOT_theorem "cqt-basic:14": (α1...∀αn (φ{α1...αn}  ψ{α1...αn}))  ((α1...∀αn φ{α1...αn})  (α1...∀αn ψ{α1...αn}))
615  using "cqt:3"[axiom_inst] by auto
616
617AOT_theorem "cqt-basic:15": (α1...∀αn (φ  ψ{α1...αn}))  (φ  (α1...∀αn ψ{α1...αn}))
618  using "cqt-orig:2" by auto
619
620(* TODO: once more the same in the embedding... need to distinguish these better *)
621AOT_theorem "universal-cor": assumes for arbitrary β: φ{β}  shows α φ{α}
622  using GEN assms .
623
624AOT_theorem "existential:1": assumes φ{τ} and τ shows α φ{α}
625proof(rule "raa-cor:1")
626  AOT_assume ¬α φ{α}
627  AOT_hence α ¬φ{α}
628    using "≡dfI" "conventions:4" RAA "&I" by blast
629  AOT_hence ¬φ{τ} using assms(2) "∀E"(1) "→E" by blast
630  AOT_thus φ{τ} & ¬φ{τ} using assms(1) "&I" by blast
631qed
632
633AOT_theorem "existential:2[const_var]": assumes φ{β} shows α φ{α}
634  using "existential:1" "cqt:2[const_var]"[axiom_inst] assms by blast
635
636AOT_theorem "existential:2[lambda]":
637  assumes φ{ν1...νn ψ{ν1...νn}]} and INSTANCE_OF_CQT_2(ψ)
638  shows α φ{α}
639  using "existential:1" "cqt:2[lambda]"[axiom_inst] assms by blast
640lemmas "∃I" = "existential:1" "existential:2[const_var]" "existential:2[lambda]" 
641
642AOT_theorem "instantiation":
643  assumes for arbitrary β: φ{β}  ψ and α φ{α}
644  shows ψ
645  by (metis (no_types, lifting) "≡dfE" GEN "raa-cor:3" "conventions:4" assms)
646lemmas "∃E" = "instantiation"
647
648AOT_theorem "cqt-further:1": α φ{α}  α φ{α}
649  using "∀E"(4) "∃I"(2) "→I" by metis
650
651AOT_theorem "cqt-further:2": ¬α φ{α}  α ¬φ{α}
652  using "∀I" "∃I"(2) "→I" RAA by metis
653
654AOT_theorem "cqt-further:3": α φ{α}  ¬α ¬φ{α}
655  using "∀E"(4) "∃E" "→I" RAA
656  by (metis "cqt-further:2" "≡I" "modus-tollens:1")
657
658AOT_theorem "cqt-further:4": ¬α φ{α}  α ¬φ{α}
659  using "∀I" "∃I"(2)"→I" RAA by metis
660
661AOT_theorem "cqt-further:5": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
662  by (metis (no_types, lifting) "&E" "&I" "∃E" "∃I"(2) "→I")
663
664AOT_theorem "cqt-further:6": α (φ{α}  ψ{α})  (α φ{α}  α ψ{α})
665  by (metis (mono_tags, lifting) "∃E" "∃I"(2) "∨E"(3) "∨I"(1, 2) "→I" RAA(2))
666
667AOT_theorem "cqt-further:7": α φ{α}  β φ{β} (* TODO: vacuous in the embedding *)
668  by (simp add: "oth-class-taut:3:a")
669
670AOT_theorem "cqt-further:8": (α φ{α} & α ψ{α})  α (φ{α}  ψ{α})
671  by (metis (mono_tags, lifting) "&E" "≡I" "∀E"(2) "→I" GEN)
672
673AOT_theorem "cqt-further:9": (¬α φ{α} & ¬α ψ{α})  α (φ{α}  ψ{α})
674  by (metis (mono_tags, lifting) "&E" "≡I" "∃I"(2) "→I" GEN "raa-cor:4")
675
676AOT_theorem "cqt-further:10": (α φ{α} & ¬α ψ{α})  ¬α (φ{α}  ψ{α})
677proof(rule "→I"; rule "raa-cor:2")
678  AOT_assume 0: α φ{α} & ¬α ψ{α}
679  then AOT_obtain α where φ{α} using "∃E" "&E"(1) by metis
680  moreover AOT_assume α (φ{α}  ψ{α})
681  ultimately AOT_have ψ{α} using "∀E"(4) "≡E"(1) by blast
682  AOT_hence α ψ{α} using "∃I" by blast
683  AOT_thus α ψ{α} & ¬α ψ{α} using 0 "&E"(2) "&I" by blast
684qed
685
686AOT_theorem "cqt-further:11": αβ φ{α,β}  βα φ{α,β}
687  using "≡I" "→I" "∃I"(2) "∃E" by metis
688
689AOT_theorem "log-prop-prop:1":  φ]
690  using "cqt:2[lambda0]"[axiom_inst] by auto
691
692AOT_theorem "log-prop-prop:2": φ
693  by (rule "≡dfI"[OF "existence:3"]) "cqt:2[lambda]"
694
695AOT_theorem "exist-nec": τ  τ
696proof -
697  AOT_have β β
698    by (simp add: GEN RN "cqt:2[const_var]"[axiom_inst])
699  AOT_thus τ  τ
700    using "cqt:1"[axiom_inst] "→E" by blast
701qed
702
703(* TODO: replace this mechanism by a "proof by types" command *)
704class AOT_Term_id = AOT_Term +
705  assumes "t=t-proper:1"[AOT]: [v  τ = τ'  τ]
706      and "t=t-proper:2"[AOT]: [v  τ = τ'  τ']
707
708instance κ :: AOT_Term_id
709proof
710  AOT_modally_strict {
711    AOT_show κ = κ'  κ for κ κ'
712    proof(rule "→I")
713      AOT_assume κ = κ'
714      AOT_hence O!κ  A!κ
715        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
716           (meson "→I" "∨I"(1) "&E"(1))+
717      AOT_thus κ
718        by (rule "∨E"(1))
719           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
720    qed
721  }
722next
723  AOT_modally_strict {
724    AOT_show κ = κ'  κ' for κ κ'
725    proof(rule "→I")
726      AOT_assume κ = κ'
727      AOT_hence O!κ'  A!κ'
728        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
729           (meson "→I" "∨I" "&E")+
730      AOT_thus κ'
731        by (rule "∨E"(1))
732           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
733    qed
734  }
735qed
736
737instance rel :: (AOT_κs) AOT_Term_id
738proof
739  AOT_modally_strict {
740    AOT_show Π = Π'  Π for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
741    proof(rule "→I")
742      AOT_assume Π = Π'
743      AOT_thus Π using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
744    qed
745  }
746next
747  AOT_modally_strict {
748    AOT_show Π = Π'  Π' for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
749    proof(rule "→I")
750      AOT_assume Π = Π'
751      AOT_thus Π' using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
752    qed
753  }
754qed
755
756instance 𝗈 :: AOT_Term_id
757proof
758  AOT_modally_strict {
759    fix φ ψ
760    AOT_show φ = ψ  φ
761    proof(rule "→I")
762      AOT_assume φ = ψ
763      AOT_thus φ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
764    qed
765  }
766next
767  AOT_modally_strict {
768    fix φ ψ
769    AOT_show φ = ψ  ψ
770    proof(rule "→I")
771      AOT_assume φ = ψ
772      AOT_thus ψ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
773    qed
774  }
775qed
776
777instance prod :: (AOT_Term_id, AOT_Term_id) AOT_Term_id
778proof
779  AOT_modally_strict {
780    fix τ τ' :: 'a×'b
781    AOT_show τ = τ'  τ
782    proof (induct τ; induct τ'; rule "→I")
783      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
784      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
785      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
786      AOT_hence τ1 and τ2 using "t=t-proper:1" "&E" "vdash-properties:10" by blast+
787      AOT_thus «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_denotes)
788    qed
789  }
790next
791  AOT_modally_strict {
792    fix τ τ' :: 'a×'b
793    AOT_show τ = τ'  τ'
794    proof (induct τ; induct τ'; rule "→I")
795      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
796      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
797      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
798      AOT_hence τ1' and τ2' using "t=t-proper:2" "&E" "vdash-properties:10" by blast+
799      AOT_thus «(τ1', τ2')» by (metis "≡dfI" "&I" tuple_denotes)
800    qed
801  }
802qed
803
804(* TODO: this is the end of the "proof by types" and makes the results available on new theorems *)
805AOT_register_type_constraints
806  Term: _::AOT_Term_id› _::AOT_Term_id›
807AOT_register_type_constraints
808  Individual: ‹κ› _::{AOT_κs, AOT_Term_id}
809AOT_register_type_constraints
810  Relation: <_::{AOT_κs, AOT_Term_id}>
811
812AOT_theorem "id-rel-nec-equiv:1": Π = Π'  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
813proof(rule "→I")
814  AOT_assume assumption: Π = Π'
815  AOT_hence Π and Π'
816    using "t=t-proper:1" "t=t-proper:2" MP by blast+
817  moreover AOT_have FG (F = G  ((x1...∀xn ([F]x1...xn  [F]x1...xn))  x1...∀xn ([F]x1...xn  [G]x1...xn)))
818    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
819  ultimately AOT_have Π = Π'  ((x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn))
820    using "∀E"(1) by blast
821  AOT_hence (x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
822    using assumption "→E" by blast
823  moreover AOT_have x1...∀xn ([Π]x1...xn  [Π]x1...xn)
824    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
825  ultimately AOT_show x1...∀xn ([Π]x1...xn  [Π']x1...xn)
826    using "→E" by blast
827qed
828
829AOT_theorem "id-rel-nec-equiv:2": φ = ψ  (φ  ψ)
830proof(rule "→I")
831  AOT_assume assumption: φ = ψ
832  AOT_hence φ and ψ
833    using "t=t-proper:1" "t=t-proper:2" MP by blast+
834  moreover AOT_have pq (p = q  (((p  p)  (p  q))))
835    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
836  ultimately AOT_have φ = ψ  ((φ  φ)  (φ  ψ))
837    using "∀E"(1) by blast
838  AOT_hence (φ  φ)  (φ  ψ)
839    using assumption "→E" by blast
840  moreover AOT_have (φ  φ)
841    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
842  ultimately AOT_show (φ  ψ)
843    using "→E" by blast
844qed
845
846AOT_theorem "rule=E": assumes φ{τ} and τ = σ shows φ{σ}
847proof -
848  AOT_have τ and σ using assms(2) "t=t-proper:1" "t=t-proper:2" "→E" by blast+
849  moreover AOT_have αβ(α = β  (φ{α}  φ{β}))
850    apply (rule GEN)+ using "l-identity"[axiom_inst] by blast
851  ultimately AOT_have τ = σ  (φ{τ}  φ{σ})
852    using "∀E"(1) by blast
853  AOT_thus φ{σ} using assms "→E" by blast
854qed
855
856AOT_theorem "propositions-lemma:1":  φ] = φ
857proof -
858  AOT_have φ by (simp add: "log-prop-prop:2")
859  moreover AOT_have p  p] = p using "lambda-predicates:3[zero]"[axiom_inst] "∀I" by fast
860  ultimately AOT_show  φ] = φ
861    using "∀E" by blast
862qed
863
864AOT_theorem "propositions-lemma:2":  φ]  φ
865proof -
866  AOT_have  φ]   φ] by (simp add: "oth-class-taut:3:a")
867  AOT_thus  φ]  φ using "propositions-lemma:1" "rule=E" by blast
868qed
869
870(* propositions-lemma:3 through propositions-lemma:5 do not apply *)
871
872AOT_theorem "propositions-lemma:6": (φ  ψ)  ( φ]   ψ])
873  by (metis "≡E"(1) "≡E"(5) "Associativity of ≡" "propositions-lemma:2")
874
875(* dr-alphabetic-rules does not apply *)
876
877AOT_theorem "oa-exist:1": O!
878proof -
879  AOT_have x [E!]x] by "cqt:2[lambda]"
880  AOT_hence 1: O! = x [E!]x] using "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1)] "→E" by blast
881  AOT_show O! using "t=t-proper:1"[THEN "→E", OF 1] by simp
882qed
883
884AOT_theorem "oa-exist:2": A!
885proof -
886  AOT_have x ¬[E!]x] by "cqt:2[lambda]"
887  AOT_hence 1: A! = x ¬[E!]x] using "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1)] "→E" by blast
888  AOT_show A! using "t=t-proper:1"[THEN "→E", OF 1] by simp
889qed
890
891AOT_theorem "oa-exist:3": O!x  A!x
892proof(rule "raa-cor:1")
893  AOT_assume ¬(O!x  A!x)
894  AOT_hence A: ¬O!x and B: ¬A!x
895    using "Disjunction Addition"(1) "modus-tollens:1" "∨I"(2) "raa-cor:5" by blast+
896  AOT_have C: O! = x [E!]x]
897    by (rule "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
898  AOT_have D: A! = x ¬[E!]x]
899    by (rule "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
900  AOT_have E: ¬x [E!]x]x
901    using A C "rule=E" by fast
902  AOT_have F: ¬x ¬[E!]x]x
903    using B D "rule=E" by fast
904  AOT_have G: x [E!]x]x  [E!]x
905    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
906  AOT_have H: x ¬[E!]x]x  ¬[E!]x
907    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
908  AOT_show ¬[E!]x & ¬¬[E!]x using G E "≡E" H F "≡E" "&I" by metis
909qed
910
911AOT_theorem "p-identity-thm2:1": F = G  x(x[F]  x[G])
912proof -
913  AOT_have F = G  F & G & x(x[F]  x[G])
914    using "identity:2" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
915  moreover AOT_have F and G
916    by (auto simp: "cqt:2[const_var]"[axiom_inst])
917  ultimately AOT_show F = G  x(x[F]  x[G])
918    using "≡S"(1) "&I" by blast
919qed
920
921AOT_theorem "p-identity-thm2:2[2]": F = G  y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
922proof -
923  AOT_have F = G  F & G & y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
924    using "identity:3[2]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
925  moreover AOT_have F and G
926    by (auto simp: "cqt:2[const_var]"[axiom_inst])
927  ultimately show ?thesis
928    using "≡S"(1) "&I" by blast
929qed
930    
931AOT_theorem "p-identity-thm2:2[3]": F = G  y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
932proof -
933  AOT_have F = G  F & G & y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
934    using "identity:3[3]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
935  moreover AOT_have F and G
936    by (auto simp: "cqt:2[const_var]"[axiom_inst])
937  ultimately show ?thesis
938    using "≡S"(1) "&I" by blast
939qed
940
941AOT_theorem "p-identity-thm2:2[4]": F = G  y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
942proof -
943  AOT_have F = G  F & G & y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
944    using "identity:3[4]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
945  moreover AOT_have F and G
946    by (auto simp: "cqt:2[const_var]"[axiom_inst])
947  ultimately show ?thesis
948    using "≡S"(1) "&I" by blast
949qed
950
951AOT_theorem "p-identity-thm2:2":
952  F = G  x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
953proof -
954  AOT_have F = G  F & G & x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
955    using "identity:3" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
956  moreover AOT_have F and G
957    by (auto simp: "cqt:2[const_var]"[axiom_inst])
958  ultimately show ?thesis
959    using "≡S"(1) "&I" by blast
960qed
961
962AOT_theorem "p-identity-thm2:3":
963  p = q  x p] = x q]
964proof -
965  AOT_have p = q  p & q & x p] = x q]
966    using "identity:4" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
967  moreover AOT_have p and q
968    by (auto simp: "cqt:2[const_var]"[axiom_inst])
969  ultimately show ?thesis
970    using "≡S"(1) "&I" by blast
971qed
972
973class AOT_Term_id_2 = AOT_Term_id + assumes "id-eq:1": [v  α = α]
974
975instance κ :: AOT_Term_id_2
976proof
977  AOT_modally_strict {
978    fix x
979    {
980      AOT_assume O!x
981      moreover AOT_have F([F]x  [F]x)
982        using RN GEN "oth-class-taut:3:a" by fast
983      ultimately AOT_have O!x & O!x & F([F]x  [F]x) using "&I" by simp
984    }
985    moreover {
986      AOT_assume A!x
987      moreover AOT_have F(x[F]  x[F])
988        using RN GEN "oth-class-taut:3:a" by fast
989      ultimately AOT_have A!x & A!x & F(x[F]  x[F]) using "&I" by simp
990    }
991    ultimately AOT_have (O!x & O!x & F([F]x  [F]x))  (A!x & A!x & F(x[F]  x[F]))
992      using "oa-exist:3" "∨I"(1) "∨I"(2) "∨E"(3) "raa-cor:1" by blast
993    AOT_thus x = x
994      using "identity:1"[THEN "df-rules-formulas[4]"] "→E" by blast
995  }
996qed
997
998instance rel :: ("{AOT_κs,AOT_Term_id_2}") AOT_Term_id_2
999proof
1000  AOT_modally_strict {
1001    fix F :: "<'a> AOT_var"
1002    AOT_have 0: x1...xn [F]x1...xn] = F
1003      by (simp add: "lambda-predicates:3"[axiom_inst])
1004    AOT_have x1...xn [F]x1...xn]
1005      by "cqt:2[lambda]"
1006    AOT_hence x1...xn [F]x1...xn] = x1...xn [F]x1...xn]
1007      using "lambda-predicates:1"[axiom_inst] "→E" by blast
1008    AOT_show F = F using "rule=E" 0 by force 
1009  }
1010qed
1011
1012instance 𝗈 :: AOT_Term_id_2
1013proof
1014  AOT_modally_strict {
1015    fix p
1016    AOT_have 0:  p] = p
1017      by (simp add: "lambda-predicates:3[zero]"[axiom_inst])
1018    AOT_have  p]
1019      by (rule "cqt:2[lambda0]"[axiom_inst])
1020    AOT_hence  p] =  p]
1021      using "lambda-predicates:1[zero]"[axiom_inst] "→E" by blast
1022    AOT_show p = p using "rule=E" 0 by force
1023  }
1024qed
1025
1026instance prod :: (AOT_Term_id_2, AOT_Term_id_2) AOT_Term_id_2
1027proof
1028  AOT_modally_strict {
1029    fix α :: ('a×'b) AOT_var›
1030    AOT_show α = α
1031    proof (induct)
1032      AOT_show τ = τ if τ for τ :: 'a×'b
1033        using that
1034      proof (induct τ)
1035        fix τ1 :: 'a and τ2 :: 'b
1036        AOT_assume «(τ1,τ2)»
1037        AOT_hence τ1 and τ2 using "≡dfE" "&E" tuple_denotes by blast+
1038        AOT_hence τ1 = τ1 and τ2 = τ2 using "id-eq:1"[unvarify α] by blast+
1039        AOT_thus «(τ1, τ2)» = «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_identity_1)
1040      qed
1041    qed
1042  }
1043qed
1044
1045AOT_register_type_constraints
1046  Term: _::AOT_Term_id_2› _::AOT_Term_id_2›
1047AOT_register_type_constraints
1048  Individual: ‹κ› _::{AOT_κs, AOT_Term_id_2}
1049AOT_register_type_constraints
1050  Relation: <_::{AOT_κs, AOT_Term_id_2}>
1051
1052(* TODO: Interestingly, this doesn't depend on "id-eq:1" at all! *)
1053AOT_theorem "id-eq:2": α = β  β = α
1054(*
1055  TODO: look at this proof generated using:
1056        including AOT_no_atp sledgehammer[isar_proofs = true]
1057proof -
1058  have "(∃φ. [v ⊨ ~β = α → ~φ] ∧ [v ⊨ α = β → φ]) ∨ (∃φ. ¬ [v ⊨ φ{α} → φ{β}])"
1059    by meson
1060  then show ?thesis
1061    by (meson "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" l_"identity:1" "useful-tautologies:1")
1062qed
1063*)
1064(*  by (meson "rule=E" "deduction-theorem") *)
1065proof (rule "→I")
1066  AOT_assume α = β
1067  moreover AOT_have β = β using calculation "rule=E"[of _ "λ τ . «τ = β»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1068  moreover AOT_have α = α  α = α using "if-p-then-p" by blast
1069  ultimately AOT_show β = α
1070    using "→E" "→I" "rule=E"[of _ "λ τ . «(τ = τ)  (τ = α)»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1071qed
1072
1073AOT_theorem "id-eq:3": α = β & β = γ  α = γ
1074  using "rule=E" "→I" "&E" by blast
1075
1076AOT_theorem "id-eq:4": α = β  γ (α = γ  β = γ)
1077proof (rule "≡I"; rule "→I")
1078  AOT_assume 0: α = β
1079  AOT_hence 1: β = α using "id-eq:2" "→E" by blast
1080  AOT_show γ (α = γ  β = γ)
1081    by (rule GEN) (metis "≡I" "→I" 0 "1" "rule=E")
1082next
1083  AOT_assume γ (α = γ  β = γ)
1084  AOT_hence α = α  β = α using "∀E"(2) by blast
1085  AOT_hence α = α  β = α using "≡E"(1) "→I" by blast
1086  AOT_hence β = α using "id-eq:1" "→E" by blast
1087  AOT_thus α = β using "id-eq:2" "→E" by blast
1088qed
1089
1090AOT_theorem "rule=I:1": assumes τ shows τ = τ
1091proof -
1092  AOT_have α (α = α)
1093    by (rule GEN) (metis "id-eq:1")
1094  AOT_thus τ = τ using assms "∀E" by blast
1095qed
1096
1097AOT_theorem "rule=I:2[const_var]": "α = α"
1098  using "id-eq:1".
1099
1100AOT_theorem "rule=I:2[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows "ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}]"
1101proof -
1102  AOT_have α (α = α)
1103    by (rule GEN) (metis "id-eq:1")
1104  moreover AOT_have ν1...νn φ{ν1...νn}] using assms by (rule "cqt:2[lambda]"[axiom_inst])
1105  ultimately AOT_show ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}] using assms "∀E" by blast
1106qed
1107
1108lemmas "=I" = "rule=I:1" "rule=I:2[const_var]" "rule=I:2[lambda]"
1109
1110AOT_theorem "rule-id-df:1":
1111  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn}
1112  shows τ{τ1...τn} = σ{τ1...τn}
1113proof -
1114  AOT_have σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}
1115    using "df-rules-terms[3]" assms(1) "&E" by blast
1116  AOT_thus τ{τ1...τn} = σ{τ1...τn}
1117    using assms(2) "→E" by blast
1118qed
1119
1120AOT_theorem "rule-id-df:1[zero]":
1121  assumes τ =df σ and σ
1122  shows τ = σ
1123proof -
1124  AOT_have σ  τ = σ
1125    using "df-rules-terms[4]" assms(1) "&E" by blast
1126  AOT_thus τ = σ
1127    using assms(2) "→E" by blast
1128qed
1129
1130AOT_theorem "rule-id-df:2:a":
1131  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{τ{τ1...τn}}
1132  shows φ{σ{τ1...τn}}
1133proof -
1134  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-df:1" assms(1,2) by blast
1135  AOT_thus φ{σ{τ1...τn}} using assms(3) "rule=E" by blast
1136qed
1137
1138(* TODO: get rid of this, ideally *)
1139AOT_theorem "rule-id-df:2:a[2]":
1140  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{τ{«(τ1,τ2)»}}
1141  shows φ{σ{«(τ1,τ2)»}}
1142proof -
1143  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1144  proof -
1145    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1146      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1147    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1148      using assms(2) "→E" by blast
1149  qed
1150  AOT_thus φ{σ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1151qed
1152
1153AOT_theorem "rule-id-df:2:a[zero]":
1154  assumes τ =df σ and σ and φ{τ}
1155  shows φ{σ}
1156proof -
1157  AOT_have τ = σ using "rule-id-df:1[zero]" assms(1,2) by blast
1158  AOT_thus φ{σ} using assms(3) "rule=E" by blast
1159qed
1160
1161lemmas "=dfE" = "rule-id-df:2:a" "rule-id-df:2:a[zero]"
1162
1163AOT_theorem "rule-id-df:2:b":
1164  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{σ{τ1...τn}}
1165  shows φ{τ{τ1...τn}}
1166proof -
1167  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-df:1" assms(1,2) by blast
1168  AOT_hence σ{τ1...τn} = τ{τ1...τn}
1169    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1170  AOT_thus φ{τ{τ1...τn}} using assms(3) "rule=E" by blast
1171qed
1172
1173(* TODO: get rid of this, ideally *)
1174AOT_theorem "rule-id-df:2:b[2]":
1175  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{σ{«(τ1,τ2)»}}
1176  shows φ{τ{«(τ1,τ2)»}}
1177proof -
1178  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1179  proof -
1180    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1181      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1182    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1183      using assms(2) "→E" by blast
1184  qed
1185  AOT_hence σ{«(τ1,τ2)»} = τ{«(τ1,τ2)»}
1186    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1187  AOT_thus φ{τ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1188qed
1189
1190AOT_theorem "rule-id-df:2:b[zero]":
1191  assumes τ =df σ and σ and φ{σ}
1192  shows φ{τ}
1193proof -
1194  AOT_have τ = σ using "rule-id-df:1[zero]" assms(1,2) by blast
1195  AOT_hence σ = τ
1196    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1197  AOT_thus φ{τ} using assms(3) "rule=E" by blast
1198qed
1199
1200lemmas "=dfI" = "rule-id-df:2:b" "rule-id-df:2:b[zero]"
1201
1202AOT_theorem "free-thms:1": τ  β (β = τ)
1203  by (metis "∃E" "rule=I:1" "t=t-proper:2" "→I" "∃I"(1) "≡I" "→E")
1204
1205AOT_theorem "free-thms:2": α φ{α}  (β (β = τ)  φ{τ})
1206  by (metis "∃E" "rule=E" "cqt:2[const_var]"[axiom_inst] "→I" "∀E"(1))
1207
1208AOT_theorem "free-thms:3[const_var]": β (β = α)
1209  by (meson "∃I"(2) "id-eq:1")
1210
1211AOT_theorem "free-thms:3[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows β (β = ν1...νn φ{ν1...νn}])
1212  by (meson "=I"(3) assms "cqt:2[lambda]"[axiom_inst] "existential:1")
1213
1214AOT_theorem "free-thms:4[rel]": ([Π]κ1...κn  κ1...κn[Π])  β (β = Π)
1215  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1216
1217(* TODO: this is a rather weird way to formulate this and we don't have tuple-existential-elimination
1218         or tuple-equality-elimination in the theory... Splitting them is also a bit unfortunate, though.*)
1219AOT_theorem "free-thms:4[vars]": ([Π]κ1...κn  κ1...κn[Π])  β1...∃βn (β1...βn = κ1...κn)
1220  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1221
1222AOT_theorem "free-thms:4[1,rel]": ([Π]κ  κ[Π])  β (β = Π)
1223  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1224AOT_theorem "free-thms:4[1,1]": ([Π]κ  κ[Π])  β (β = κ)
1225  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1226
1227AOT_theorem "free-thms:4[2,rel]": ([Π]κ1κ2  κ1κ2[Π])  β (β = Π)
1228  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1229AOT_theorem "free-thms:4[2,1]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ1)
1230  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1231AOT_theorem "free-thms:4[2,2]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ2)
1232  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1233AOT_theorem "free-thms:4[3,rel]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = Π)
1234  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1235AOT_theorem "free-thms:4[3,1]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ1)
1236  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1237AOT_theorem "free-thms:4[3,2]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ2)
1238  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1239AOT_theorem "free-thms:4[3,3]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ3)
1240  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1241AOT_theorem "free-thms:4[4,rel]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = Π)
1242  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1243AOT_theorem "free-thms:4[4,1]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ1)
1244  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1245AOT_theorem "free-thms:4[4,2]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ2)
1246  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1247AOT_theorem "free-thms:4[4,3]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ3)
1248  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1249AOT_theorem "free-thms:4[4,4]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ4)
1250  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1251
1252AOT_theorem "ex:1:a": α α
1253  by (rule GEN) (fact "cqt:2[const_var]"[axiom_inst])
1254AOT_theorem "ex:1:b": αβ(β = α)
1255  by (rule GEN) (fact "free-thms:3[const_var]")
1256
1257AOT_theorem "ex:2:a": α
1258  by (rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1259AOT_theorem "ex:2:b": β(β = α)
1260  by (rule RN) (fact "free-thms:3[const_var]")
1261
1262AOT_theorem "ex:3:a": α α
1263  by (rule RN) (fact "ex:1:a")
1264AOT_theorem "ex:3:b": αβ(β = α)
1265  by (rule RN) (fact "ex:1:b")
1266
1267AOT_theorem "ex:4:a": α α
1268  by (rule GEN; rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1269AOT_theorem "ex:4:b": αβ(β = α)
1270  by (rule GEN; rule RN) (fact "free-thms:3[const_var]")
1271
1272AOT_theorem "ex:5:a": α α
1273  by (rule RN) (simp add: "ex:4:a")
1274AOT_theorem "ex:5:b": αβ(β = α)
1275  by (rule RN) (simp add: "ex:4:b")
1276
1277AOT_theorem "all-self=:1": α(α = α)
1278  by (rule RN; rule GEN) (fact "id-eq:1")
1279AOT_theorem "all-self=:2": α(α = α)
1280  by (rule GEN; rule RN) (fact "id-eq:1")
1281
1282AOT_theorem "id-nec:1": α = β  (α = β)
1283proof(rule "→I")
1284  AOT_assume α = β
1285  moreover AOT_have (α = α)
1286    by (rule RN) (fact "id-eq:1")
1287  ultimately AOT_show (α = β) using "rule=E" by fast
1288qed
1289
1290AOT_theorem "id-nec:2": τ = σ  (τ = σ)
1291proof(rule "→I")
1292  AOT_assume asm: τ = σ
1293  moreover AOT_have τ
1294    using calculation "t=t-proper:1" "→E" by blast
1295  moreover AOT_have (τ = τ)
1296    using calculation "all-self=:2" "∀E"(1) by blast
1297  ultimately AOT_show (τ = σ) using "rule=E" by fast
1298qed
1299
1300AOT_theorem "term-out:1": φ{α}  β (β = α & φ{β})
1301proof (rule "≡I"; rule "→I")
1302  AOT_assume asm: φ{α}
1303  AOT_show β (β = α & φ{β})
1304    by (rule "∃I"(2)[where β=α]; rule "&I")
1305       (auto simp: "id-eq:1" asm)
1306next
1307  AOT_assume 0: β (β = α & φ{β})
1308  (* TODO: have another look at this instantiation. Ideally AOT_obtain would resolve directly to the existential
1309           statement as proof obligation *)
1310  AOT_obtain β where β = α & φ{β} using "instantiation"[rotated, OF 0] by blast
1311  AOT_thus φ{α} using "&E" "rule=E" by blast
1312qed
1313
1314AOT_theorem "term-out:2": τ  (φ{τ}  α(α = τ & φ{α}))
1315proof(rule "→I")
1316  AOT_assume τ
1317  moreover AOT_have α (φ{α}  β (β = α & φ{β}))
1318    by (rule GEN) (fact "term-out:1")
1319  ultimately AOT_show φ{τ}  α(α = τ & φ{α})
1320    using "∀E" by blast
1321qed
1322
1323(* TODO: example of an apply-style proof. Keep or reformulate? *)
1324AOT_theorem "term-out:3": (φ{α} & β(φ{β}  β = α))  β(φ{β}  β = α)
1325  apply (rule "≡I"; rule "→I")
1326   apply (frule "&E"(1)) apply (drule "&E"(2))
1327   apply (rule GEN; rule "≡I"; rule "→I")
1328  using "rule-ui:2[const_var]" "vdash-properties:5" apply blast
1329  apply (meson "rule=E" "id-eq:1")
1330  apply (rule "&I")
1331  using "id-eq:1" "≡E"(2) "rule-ui:3" apply blast
1332  apply (rule GEN; rule "→I")
1333  using "≡E"(1) "rule-ui:2[const_var]" by blast
1334
1335AOT_theorem "term-out:4": (φ{β} & α(φ{α}  α = β))  α(φ{α}  α = β)
1336  using "term-out:3" . (* TODO: same as above - another instance of the generalized alphabetic variant rule... *)
1337
1338(* TODO: would of course be nice to define it without the syntax magic *)
1339AOT_define AOT_exists_unique :: ‹α  φ  φ›
1340  "uniqueness:1": «AOT_exists_unique φ» df α (φ{α} & β (φ{β}  β = α))
1341syntax "_AOT_exists_unique" :: ‹α  φ  φ› ("∃!_ _" [1,40])
1342AOT_syntax_print_translations
1343  "_AOT_exists_unique τ φ" <= "CONST AOT_exists_unique (_abs τ φ)"
1344syntax
1345   "_AOT_exists_unique_ellipse" :: ‹id_position  id_position  φ  φ› (∃!_...∃!_ _› [1,40])
1346parse_ast_translation[(syntax_const‹_AOT_exists_unique_ellipse›, fn ctx => fn [a,b,c] =>
1347  Ast.mk_appl (Ast.Constant "AOT_exists_unique") [parseEllipseList "_AOT_vars" ctx [a,b],c]),
1348(syntax_const‹_AOT_exists_unique›,AOT_restricted_binder const_name‹AOT_exists_unique› const_syntax‹AOT_conj›)]
1349print_translationAOT_syntax_print_translations
1350  [AOT_preserve_binder_abs_tr' const_syntax‹AOT_exists_unique› syntax_const‹_AOT_exists_unique› (syntax_const‹_AOT_exists_unique_ellipse›, true) const_name‹AOT_conj›,
1351  AOT_binder_trans @{theory} @{binding "AOT_exists_unique_binder"} syntax_const‹_AOT_exists_unique›]
1352
1353
1354
1355context AOT_meta_syntax
1356begin
1357notation AOT_exists_unique (binder "!" 20)
1358end
1359context AOT_no_meta_syntax
1360begin
1361no_notation AOT_exists_unique (binder "!" 20)
1362end
1363
1364AOT_theorem "uniqueness:2": ∃!α φ{α}  αβ(φ{β}  β = α)
1365proof(rule "≡I"; rule "→I")
1366    AOT_assume ∃!α φ{α}
1367    AOT_hence α (φ{α} & β (φ{β}  β = α))
1368      using "uniqueness:1" "≡dfE" by blast
1369    then AOT_obtain α where φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1370    AOT_hence β(φ{β}  β = α) using "term-out:3" "≡E" by blast
1371    AOT_thus αβ(φ{β}  β = α)
1372      using "∃I" by fast
1373next
1374    AOT_assume αβ(φ{β}  β = α)
1375    then AOT_obtain α where β (φ{β}  β = α) using "instantiation"[rotated] by blast
1376    AOT_hence φ{α} & β (φ{β}  β = α) using "term-out:3" "≡E" by blast
1377    AOT_hence α (φ{α} & β (φ{β}  β = α))
1378      using "∃I" by fast
1379    AOT_thus ∃!α φ{α}
1380      using "uniqueness:1" "≡dfI" by blast
1381qed
1382
1383AOT_theorem "uni-most": ∃!α φ{α}  βγ((φ{β} & φ{γ})  β = γ)
1384proof(rule "→I"; rule GEN; rule GEN; rule "→I")
1385  fix β γ
1386  AOT_assume ∃!α φ{α}
1387  AOT_hence αβ(φ{β}  β = α)
1388    using "uniqueness:2" "≡E" by blast
1389  then AOT_obtain α where β(φ{β}  β = α)
1390    using "instantiation"[rotated] by blast
1391  moreover AOT_assume φ{β} & φ{γ}
1392  ultimately AOT_have β = α and γ = α
1393    using "∀E"(2) "&E" "≡E"(1,2) by blast+
1394  AOT_thus β = γ
1395    by (metis "rule=E" "id-eq:2" "→E")
1396qed
1397
1398AOT_theorem "nec-exist-!": α(φ{α}  φ{α})  (∃!α φ{α}  ∃!α φ{α})
1399proof (rule "→I"; rule "→I")
1400  AOT_assume a: α(φ{α}  φ{α})
1401  AOT_assume ∃!α φ{α}
1402  AOT_hence α (φ{α} & β (φ{β}  β = α)) using "uniqueness:1" "≡dfE" by blast
1403  then AOT_obtain α where ξ: φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1404  AOT_have φ{α}
1405    using ξ a "&E" "∀E" "→E" by fast
1406  moreover AOT_have β (φ{β}  β = α)
1407    apply (rule GEN; rule "→I")
1408    using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
1409  ultimately AOT_have (φ{α} & β (φ{β}  β = α))
1410    using "&I" by blast
1411  AOT_thus ∃!α φ{α}
1412    using "uniqueness:1" "≡dfI" "∃I" by fast
1413qed
1414
1415AOT_theorem "act-cond": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1416  using "→I" "≡E"(1) "logic-actual-nec:2"[axiom_inst] by blast
1417
1418AOT_theorem "nec-imp-act": φ  𝒜φ
1419  by (metis "act-cond" "contraposition:1[2]" "≡E"(4) "qml:2"[THEN act_closure, axiom_inst] "qml-act:2"[axiom_inst] RAA(1) "→E" "→I")
1420
1421AOT_theorem "act-conj-act:1": 𝒜(𝒜φ  φ)
1422  using "→I" "≡E"(2) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] by blast
1423
1424AOT_theorem "act-conj-act:2": 𝒜(φ  𝒜φ)
1425  by (metis "→I" "≡E"(2, 4) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] RAA(1))
1426
1427AOT_theorem "act-conj-act:3": (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1428proof -
1429  AOT_have (φ  (ψ  (φ & ψ)))
1430    by (rule RN) (fact Adjunction)
1431  AOT_hence 𝒜(φ  (ψ  (φ & ψ)))
1432    using "nec-imp-act" "→E" by blast
1433  AOT_hence 𝒜φ  𝒜(ψ  (φ & ψ))
1434    using "act-cond" "→E" by blast
1435  moreover AOT_have 𝒜(ψ  (φ & ψ))  (𝒜ψ  𝒜(φ & ψ))
1436    by (fact "act-cond")
1437  ultimately AOT_have 𝒜φ  (𝒜ψ  𝒜(φ & ψ))
1438    using "→I" "→E" by metis
1439  AOT_thus (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1440    by (metis Importation "→E")
1441qed
1442
1443AOT_theorem "act-conj-act:4": 𝒜(𝒜φ  φ)
1444proof -
1445  AOT_have (𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ))  𝒜((𝒜φ  φ) & (φ  𝒜φ))
1446    by (fact "act-conj-act:3")
1447  moreover AOT_have 𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ)
1448    using "&I" "act-conj-act:1" "act-conj-act:2" by simp
1449  ultimately AOT_have ζ: 𝒜((𝒜φ  φ) & (φ  𝒜φ))
1450    using "→E" by blast
1451  AOT_have 𝒜(((𝒜φ  φ) & (φ  𝒜φ))  (𝒜φ  φ))
1452    using "conventions:3"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst] by blast
1453  AOT_hence 𝒜((𝒜φ  φ) & (φ  𝒜φ))  𝒜(𝒜φ  φ)
1454    using "act-cond" "→E" by blast
1455  AOT_thus 𝒜(𝒜φ  φ) using ζ "→E" by blast
1456qed
1457
1458(* TODO: consider introducing AOT_inductive *)
1459inductive arbitrary_actualization for φ where
1460  arbitrary_actualization φ «𝒜φ»
1461| arbitrary_actualization φ «𝒜ψ» if arbitrary_actualization φ ψ
1462declare arbitrary_actualization.cases[AOT] arbitrary_actualization.induct[AOT]
1463        arbitrary_actualization.simps[AOT] arbitrary_actualization.intros[AOT]
1464syntax arbitrary_actualization :: ‹φ'  φ'  AOT_prop› ("ARBITRARY'_ACTUALIZATION'(_,_')")
1465
1466notepad
1467begin
1468  AOT_modally_strict {
1469    fix φ
1470    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜(𝒜φ  φ))
1471      using AOT_PLM.arbitrary_actualization.intros by metis
1472    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜(𝒜φ  φ))
1473      using AOT_PLM.arbitrary_actualization.intros by metis
1474    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜𝒜(𝒜φ  φ))
1475      using AOT_PLM.arbitrary_actualization.intros by metis
1476  }
1477end
1478
1479
1480AOT_theorem "closure-act:1": assumes ARBITRARY_ACTUALIZATION(𝒜φ  φ, ψ) shows ψ
1481using assms proof(induct)
1482  case 1
1483  AOT_show 𝒜(𝒜φ  φ)
1484    by (simp add: "act-conj-act:4")
1485next
1486  case (2 ψ)
1487  AOT_thus 𝒜ψ
1488    by (metis arbitrary_actualization.simps "≡E"(1) "logic-actual-nec:4"[axiom_inst])
1489qed
1490
1491AOT_theorem "closure-act:2": α 𝒜(𝒜φ{α}  φ{α})
1492  by (simp add: "act-conj-act:4" "∀I")
1493
1494AOT_theorem "closure-act:3": 𝒜α 𝒜(𝒜φ{α}  φ{α})
1495  by (metis (no_types, lifting) "act-conj-act:4" "≡E"(1,2) "logic-actual-nec:3"[axiom_inst] "logic-actual-nec:4"[axiom_inst] "∀I")
1496
1497AOT_theorem "closure-act:4": 𝒜α1...∀αn 𝒜(𝒜φ{α1...αn}  φ{α1...αn})
1498  using "closure-act:3" .
1499
1500(* TODO: examine these proofs *)
1501AOT_theorem "RA[1]": assumes  φ shows  𝒜φ
1502  (* This proof is the one rejected in remark (136) (meta-rule) *)
1503  using "¬¬E" assms "≡E"(3) "logic-actual"[act_axiom_inst] "logic-actual-nec:1"[axiom_inst] "modus-tollens:2" by blast
1504AOT_theorem "RA[2]": assumes  φ shows 𝒜φ
1505  (* This is actually Γ ⊢ φ ⟹ □Γ ⊢ 𝒜φ*)
1506  using RN assms "nec-imp-act" "vdash-properties:5" by blast
1507AOT_theorem "RA[3]": assumes Γ  φ shows 𝒜Γ  𝒜φ
1508  using assms by (meson AOT_sem_act imageI)
1509  (* This is not exactly right either. *)
1510
1511AOT_act_theorem "ANeg:1": ¬𝒜φ  ¬φ
1512  by (simp add: "RA[1]" "contraposition:1[1]" "deduction-theorem" "≡I" "logic-actual"[act_axiom_inst])
1513
1514AOT_act_theorem "ANeg:2": ¬𝒜¬φ  φ
1515  using "ANeg:1" "≡I" "≡E"(5) "useful-tautologies:1" "useful-tautologies:2" by blast
1516
1517AOT_theorem "Act-Basic:1": 𝒜φ  𝒜¬φ
1518  by (meson "∨I"(1,2) "≡E"(2) "logic-actual-nec:1"[axiom_inst] "raa-cor:1")
1519
1520AOT_theorem "Act-Basic:2": 𝒜(φ & ψ)  (𝒜φ & 𝒜ψ)
1521proof (rule "≡I"; rule "→I")
1522  AOT_assume 𝒜(φ & ψ)
1523  moreover AOT_have 𝒜((φ & ψ)  φ)
1524    by (simp add: "RA[2]" "Conjunction Simplification"(1))
1525  moreover AOT_have 𝒜((φ & ψ)  ψ)
1526    by (simp add: "RA[2]" "Conjunction Simplification"(2))
1527  ultimately AOT_show 𝒜φ & 𝒜ψ
1528    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1529next
1530  AOT_assume 𝒜φ & 𝒜ψ
1531  AOT_thus 𝒜(φ & ψ)
1532    using "act-conj-act:3" "vdash-properties:6" by blast
1533qed
1534
1535AOT_theorem "Act-Basic:3": 𝒜(φ  ψ)  (𝒜(φ  ψ) & 𝒜(ψ  φ))
1536proof (rule "≡I"; rule "→I")
1537  AOT_assume 𝒜(φ  ψ)
1538  moreover AOT_have 𝒜((φ  ψ)  (φ  ψ))
1539    by (simp add: "RA[2]" "deduction-theorem" "≡E"(1))
1540  moreover AOT_have 𝒜((φ  ψ)  (ψ  φ))
1541    by (simp add: "RA[2]" "deduction-theorem" "≡E"(2))
1542  ultimately AOT_show 𝒜(φ  ψ) & 𝒜(ψ  φ)
1543    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1544next
1545  AOT_assume 𝒜(φ  ψ) & 𝒜(ψ  φ)
1546  AOT_hence 𝒜((φ  ψ) & (ψ  φ))
1547    by (metis "act-conj-act:3" "vdash-properties:10")
1548  moreover AOT_have 𝒜(((φ  ψ) & (ψ  φ))  (φ  ψ))
1549    by (simp add: "conventions:3" "RA[2]" "df-rules-formulas[2]" "vdash-properties:1[2]")
1550  ultimately AOT_show 𝒜(φ  ψ)
1551    using "act-cond"[THEN "→E", THEN "→E"] by metis
1552qed
1553
1554AOT_theorem "Act-Basic:4": (𝒜(φ  ψ) & 𝒜(ψ  φ))  (𝒜φ  𝒜ψ)
1555proof (rule "≡I"; rule "→I")
1556  AOT_assume 0: 𝒜(φ  ψ) & 𝒜(ψ  φ)
1557  AOT_show 𝒜φ  𝒜ψ
1558    using 0 "&E" "act-cond"[THEN "→E", THEN "→E"] "≡I" "→I" by metis
1559next
1560  AOT_assume 𝒜φ  𝒜ψ
1561  AOT_thus 𝒜(φ  ψ) & 𝒜(ψ  φ)
1562    by (metis "→I" "logic-actual-nec:2"[axiom_inst] "≡E"(1,2) "&I")
1563qed
1564
1565AOT_theorem "Act-Basic:5": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1566  using "Act-Basic:3" "Act-Basic:4" "≡E"(5) by blast
1567
1568AOT_theorem "Act-Basic:6": 𝒜φ  𝒜φ
1569  by (simp add: "≡I" "qml:2"[axiom_inst] "qml-act:1"[axiom_inst])
1570
1571AOT_theorem "Act-Basic:7": 𝒜φ  𝒜φ
1572  by (metis "Act-Basic:6" "→I" "→E" "≡E"(1,2) "nec-imp-act" "qml-act:2"[axiom_inst])
1573
1574AOT_theorem "Act-Basic:8": φ  𝒜φ
1575  using "Hypothetical Syllogism" "nec-imp-act" "qml-act:1"[axiom_inst] by blast
1576
1577AOT_theorem "Act-Basic:9": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1578proof (rule "≡I"; rule "→I")
1579  AOT_assume 𝒜(φ  ψ)
1580  AOT_thus 𝒜φ  𝒜ψ
1581  proof (rule "raa-cor:3")
1582    AOT_assume ¬(𝒜φ  𝒜ψ)
1583    AOT_hence ¬𝒜φ & ¬𝒜ψ
1584      by (metis "≡E"(1) "oth-class-taut:5:d")
1585    AOT_hence 𝒜¬φ & 𝒜¬ψ
1586      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] "&E" "&I" by metis
1587    AOT_hence 𝒜(¬φ & ¬ψ)
1588      using "≡E" "Act-Basic:2" by metis
1589    moreover AOT_have 𝒜((¬φ & ¬ψ)  ¬(φ  ψ))
1590      using "RA[2]" "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:d" by blast
1591    moreover AOT_have 𝒜(¬φ & ¬ψ)  𝒜(¬(φ  ψ))
1592      using calculation(2) by (metis "Act-Basic:5" "≡E"(1))
1593    ultimately AOT_have 𝒜(¬(φ  ψ)) using "≡E" by blast
1594    AOT_thus ¬𝒜(φ  ψ)
1595      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by auto
1596  qed
1597next
1598  AOT_assume 𝒜φ  𝒜ψ
1599  AOT_thus 𝒜(φ  ψ)
1600    by (meson "RA[2]" "act-cond" "∨I"(1) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
1601qed
1602
1603AOT_theorem "Act-Basic:10": 𝒜α φ{α}  α 𝒜φ{α}
1604proof -
1605  AOT_have θ: ¬𝒜α ¬φ{α}  ¬α 𝒜¬φ{α}
1606    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1607       (metis "logic-actual-nec:3"[axiom_inst])
1608  AOT_have ξ: ¬α 𝒜¬φ{α}  ¬α ¬𝒜φ{α}
1609    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1610       (rule "logic-actual-nec:1"[THEN universal_closure, axiom_inst, THEN "cqt-basic:3"[THEN "→E"]])
1611  AOT_have 𝒜(α φ{α})  𝒜(¬α ¬φ{α})
1612    using "conventions:4"[THEN "df-rules-formulas[1]", THEN act_closure, axiom_inst]
1613          "conventions:4"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst]
1614    "Act-Basic:4"[THEN "≡E"(1)] "&I" "Act-Basic:5"[THEN "≡E"(2)] by metis
1615  also AOT_have   ¬𝒜α ¬φ{α}
1616    by (simp add: "logic-actual-nec:1" "vdash-properties:1[2]")
1617  also AOT_have   ¬α 𝒜 ¬φ{α} using θ by blast
1618  also AOT_have   ¬α ¬𝒜 φ{α} using ξ by blast
1619  also AOT_have   α 𝒜 φ{α}
1620    using "conventions:4"[THEN "≡Df"] by (metis "≡E"(6) "oth-class-taut:3:a")
1621  finally AOT_show 𝒜α φ{α}  α 𝒜φ{α} .
1622qed
1623
1624
1625AOT_theorem "Act-Basic:11": 𝒜α(φ{α}  ψ{α})  α(𝒜φ{α}  𝒜ψ{α})
1626proof(rule "≡I"; rule "→I")
1627  AOT_assume 𝒜α(φ{α}  ψ{α})
1628  AOT_hence α𝒜(φ{α}  ψ{α})
1629    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] by blast
1630  AOT_hence 𝒜(φ{α}  ψ{α}) for α using "∀E" by blast
1631  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α by (metis "Act-Basic:5" "≡E"(1))
1632  AOT_thus α(𝒜φ{α}  𝒜ψ{α}) by (rule "∀I")
1633next
1634  AOT_assume α(𝒜φ{α}  𝒜ψ{α})
1635  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α using "∀E" by blast
1636  AOT_hence 𝒜(φ{α}  ψ{α}) for α by (metis "Act-Basic:5" "≡E"(2))
1637  AOT_hence α 𝒜(φ{α}  ψ{α}) by (rule "∀I")
1638  AOT_thus 𝒜α(φ{α}  ψ{α})
1639    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
1640qed
1641
1642AOT_act_theorem "act-quant-uniq": β(𝒜φ{β}  β = α)  β(φ{β}  β = α)
1643proof(rule "≡I"; rule "→I")
1644  AOT_assume β(𝒜φ{β}  β = α)
1645  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1646  AOT_hence φ{β}  β = α for β
1647    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1648    by metis
1649  AOT_thus β(φ{β}  β = α) by (rule "∀I")
1650next
1651  AOT_assume β(φ{β}  β = α)
1652  AOT_hence φ{β}  β = α for β using "∀E" by blast
1653  AOT_hence 𝒜φ{β}  β = α for β
1654    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1655    by metis
1656  AOT_thus β(𝒜φ{β}  β = α) by (rule "∀I")
1657qed
1658
1659AOT_act_theorem "fund-cont-desc": x = ιx(φ{x})  z(φ{z}  z = x)
1660  using descriptions[axiom_inst] "act-quant-uniq" "≡E"(5) by fast
1661
1662AOT_act_theorem hintikka: x = ιx(φ{x})  (φ{x} & z (φ{z}  z = x))
1663  using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" "fund-cont-desc" "≡E"(5) by blast
1664
1665
1666locale russel_axiom =
1667  fixes ψ
1668  assumes ψ_denotes_asm: "[v  ψ{κ}]  [v  κ]"
1669begin
1670AOT_act_theorem "russell-axiom": ψ{ιx φ{x}}  x(φ{x} & z(φ{z}  z = x) & ψ{x})
1671proof -
1672  AOT_have b: x (x = ιx φ{x}  (φ{x} & z(φ{z}  z = x)))
1673    using hintikka "∀I" by fast
1674  show ?thesis
1675  proof(rule "≡I"; rule "→I")
1676    AOT_assume c: ψ{ιx φ{x}}
1677    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1678    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1679    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1680    moreover AOT_have a = ιx φ{x}  (φ{a} & z(φ{z}  z = a)) using b "∀E" by blast
1681    ultimately AOT_have φ{a} & z(φ{z}  z = a) using "≡E" by blast
1682    moreover AOT_have ψ{a}
1683    proof - 
1684      AOT_have 1: xy(x = y  y = x)
1685        by (simp add: "id-eq:2" "universal-cor")
1686      AOT_have a = ιx φ{x}   ιx φ{x} = a
1687        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1688           (auto simp: 1 d "universal-cor")
1689      AOT_thus ψ{a}
1690        using a_def c "rule=E" "→E" by blast
1691    qed
1692    ultimately AOT_have φ{a} & z(φ{z}  z = a) & ψ{a} by (rule "&I")
1693    AOT_thus x(φ{x} & z(φ{z}  z = x) & ψ{x}) by (rule "∃I")
1694  next
1695    AOT_assume x(φ{x} & z(φ{z}  z = x) & ψ{x})
1696    then AOT_obtain b where g: φ{b} & z(φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1697    AOT_hence h: b = ιx φ{x}  (φ{b} & z(φ{z}  z = b)) using b "∀E" by blast
1698    AOT_have φ{b} & z(φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1699    AOT_hence b = ιx φ{x} using h "≡E" by blast
1700    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1701  qed
1702qed
1703end
1704
1705(* TODO: this nicely shows off using locales with the embedding, but maybe there is still a nicer way *)
1706(* TODO: sledgehammer tends to refer to ψ_denotes_asm in these instantiation instead of referring
1707         to cqt:5:a - should be fixed *)
1708interpretation "russell-axiom[exe,1]": russel_axiom λ κ . «[Π]κ»
1709  by standard (metis "cqt:5:a[1]"[axiom_inst, THEN "→E"] "&E"(2))
1710interpretation "russell-axiom[exe,2,1,1]": russel_axiom λ κ . «[Π]κκ'»
1711  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E")
1712interpretation "russell-axiom[exe,2,1,2]": russel_axiom λ κ . «[Π]κ'κ»
1713  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1714interpretation "russell-axiom[exe,2,2]": russel_axiom λ κ . «[Π]κκ»
1715  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1716interpretation "russell-axiom[exe,3,1,1]": russel_axiom λ κ . «[Π]κκ'κ''»
1717  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1718interpretation "russell-axiom[exe,3,1,2]": russel_axiom λ κ . «[Π]κ'κκ''»
1719  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1720interpretation "russell-axiom[exe,3,1,3]": russel_axiom λ κ . «[Π]κ'κ''κ»
1721  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1722interpretation "russell-axiom[exe,3,2,1]": russel_axiom λ κ . «[Π]κκκ'»
1723  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1724interpretation "russell-axiom[exe,3,2,2]": russel_axiom λ κ . «[Π]κκ'κ»
1725  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1726interpretation "russell-axiom[exe,3,2,3]": russel_axiom λ κ . «[Π]κ'κκ»
1727  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1728interpretation "russell-axiom[exe,3,3]": russel_axiom λ κ . «[Π]κκκ»
1729  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1730
1731interpretation "russell-axiom[enc,1]": russel_axiom λ κ . «κ[Π]»
1732  by standard (metis "cqt:5:b[1]"[axiom_inst, THEN "→E"] "&E"(2))
1733interpretation "russell-axiom[enc,2,1]": russel_axiom λ κ . «κκ'[Π]»
1734  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E")
1735interpretation "russell-axiom[enc,2,2]": russel_axiom λ κ . «κ'κ[Π]»
1736  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1737interpretation "russell-axiom[enc,2,3]": russel_axiom λ κ . «κκ[Π]»
1738  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1739interpretation "russell-axiom[enc,3,1,1]": russel_axiom λ κ . «κκ'κ''[Π]»
1740  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1741interpretation "russell-axiom[enc,3,1,2]": russel_axiom λ κ . «κ'κκ''[Π]»
1742  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1743interpretation "russell-axiom[enc,3,1,3]": russel_axiom λ κ . «κ'κ''κ[Π]»
1744  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1745interpretation "russell-axiom[enc,3,2,1]": russel_axiom λ κ . «κκκ'[Π]»
1746  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1747interpretation "russell-axiom[enc,3,2,2]": russel_axiom λ κ . «κκ'κ[Π]»
1748  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1749interpretation "russell-axiom[enc,3,2,3]": russel_axiom λ κ . «κ'κκ[Π]»
1750  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1751interpretation "russell-axiom[enc,3,3]": russel_axiom λ κ . «κκκ[Π]»
1752  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1753
1754AOT_act_theorem "1-exists:1": ιx φ{x}  ∃!x φ{x}
1755proof(rule "≡I"; rule "→I")
1756  AOT_assume ιx φ{x}
1757  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1758  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1759  AOT_hence φ{a} & z (φ{z}  z = a) using hintikka "≡E" by blast
1760  AOT_hence x (φ{x} & z (φ{z}  z = x)) by (rule "∃I")
1761  AOT_thus ∃!x φ{x} using "uniqueness:1"[THEN "≡dfI"] by blast
1762next
1763  AOT_assume ∃!x φ{x}
1764  AOT_hence x (φ{x} & z (φ{z}  z = x))
1765    using "uniqueness:1"[THEN "≡dfE"] by blast
1766  then AOT_obtain b where φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
1767  AOT_hence b = ιx φ{x} using hintikka "≡E" by blast
1768  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1769qed
1770
1771AOT_act_theorem "1-exists:2": y(y=ιx φ{x})  ∃!x φ{x}
1772  using "1-exists:1" "free-thms:1" "≡E"(6) by blast
1773
1774AOT_act_theorem "y-in:1": x = ιx φ{x}  φ{x}
1775  using "&E"(1) "→I" hintikka "≡E"(1) by blast
1776
1777AOT_act_theorem "y-in:2": z = ιx φ{x}  φ{z} using "y-in:1". (* TODO: same as above *)
1778
1779AOT_act_theorem "y-in:3": ιx φ{x}  φ{ιx φ{x}}
1780proof(rule "→I")
1781  AOT_assume ιx φ{x}
1782  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1783  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1784  moreover AOT_have φ{a} using calculation hintikka "≡E"(1) "&E" by blast
1785  ultimately AOT_show φ{ιx φ{x}} using "rule=E" by blast
1786qed
1787
1788AOT_act_theorem "y-in:4": y (y = ιx φ{x})  φ{ιx φ{x}}
1789  using "y-in:3"[THEN "→E"] "free-thms:1"[THEN "≡E"(2)] "→I" by blast
1790
1791
1792AOT_theorem "act-quant-nec": β (𝒜φ{β}  β = α)  β(𝒜𝒜φ{β}  β = α)
1793proof(rule "≡I"; rule "→I")
1794  AOT_assume β (𝒜φ{β}  β = α)
1795  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1796  AOT_hence 𝒜𝒜φ{β}  β = α for β 
1797    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1798  AOT_thus β(𝒜𝒜φ{β}  β = α)
1799    by (rule "∀I")
1800next
1801  AOT_assume β(𝒜𝒜φ{β}  β = α)
1802  AOT_hence 𝒜𝒜φ{β}  β = α for β using "∀E" by blast
1803  AOT_hence 𝒜φ{β}  β = α for β
1804    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1805  AOT_thus β (𝒜φ{β}  β = α)
1806    by (rule "∀I")
1807qed
1808
1809AOT_theorem "equi-desc-descA:1": x = ιx φ{x}  x = ιx(𝒜φ{x})
1810proof -
1811  AOT_have x = ιx φ{x}  z (𝒜φ{z}  z = x)  using descriptions[axiom_inst] by blast
1812  also AOT_have ...  z (𝒜𝒜φ{z}  z = x)
1813  proof(rule "≡I"; rule "→I"; rule "∀I")
1814    AOT_assume z (𝒜φ{z}  z = x)
1815    AOT_hence 𝒜φ{a}  a = x for a using "∀E" by blast
1816    AOT_thus 𝒜𝒜φ{a}  a = x for a by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1817  next
1818    AOT_assume z (𝒜𝒜φ{z}  z = x)
1819    AOT_hence 𝒜𝒜φ{a}  a = x for a using "∀E" by blast
1820    AOT_thus 𝒜φ{a}  a = x for a  by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1821  qed
1822  also AOT_have ...  x = ιx(𝒜φ{x})
1823    using "Commutativity of ≡"[THEN "≡E"(1)] descriptions[axiom_inst] by fast
1824  finally show ?thesis .
1825qed
1826
1827AOT_theorem "equi-desc-descA:2": ιx φ{x}  ιx φ{x} = ιx(𝒜φ{x})
1828proof(rule "→I")
1829  AOT_assume ιx φ{x}
1830  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1831  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1832  moreover AOT_have a = ιx(𝒜φ{x}) using calculation "equi-desc-descA:1"[THEN "≡E"(1)] by blast
1833  ultimately AOT_show ιx φ{x} = ιx(𝒜φ{x}) using "rule=E" by fast
1834qed
1835
1836AOT_theorem "nec-hintikka-scheme": x = ιx φ{x}  𝒜φ{x} & z(𝒜φ{z}  z = x)
1837proof -
1838  AOT_have x = ιx φ{x}  z(𝒜φ{z}  z = x) using descriptions[axiom_inst] by blast
1839  also AOT_have   (𝒜φ{x} & z(𝒜φ{z}  z = x))
1840    using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" by fast
1841  finally show ?thesis.
1842qed
1843
1844AOT_theorem "equiv-desc-eq:1": 𝒜x(φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1845proof(rule "→I"; rule "∀I")
1846  fix β
1847  AOT_assume 𝒜x(φ{x}  ψ{x})
1848  AOT_hence 𝒜(φ{x}  ψ{x}) for x using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] "∀E"(2) by blast
1849  AOT_hence 0: 𝒜φ{x}  𝒜ψ{x} for x by (metis "Act-Basic:5" "≡E"(1))
1850  AOT_have β = ιx φ{x}  𝒜φ{β} & z(𝒜φ{z}  z = β) using "nec-hintikka-scheme" by blast
1851  also AOT_have ...  𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1852  proof (rule "≡I"; rule "→I")
1853    AOT_assume 1: 𝒜φ{β} & z(𝒜φ{z}  z = β)
1854    AOT_hence 𝒜φ{z}  z = β for z using "&E" "∀E" by blast
1855    AOT_hence 𝒜ψ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1856    AOT_hence z(𝒜ψ{z}  z = β) using "∀I" by fast
1857    moreover AOT_have 𝒜ψ{β} using "&E" 0[THEN "≡E"(1)] 1 by blast
1858    ultimately AOT_show 𝒜ψ{β} & z(𝒜ψ{z}  z = β) using "&I" by blast
1859  next
1860    AOT_assume 1: 𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1861    AOT_hence 𝒜ψ{z}  z = β for z using "&E" "∀E" by blast
1862    AOT_hence 𝒜φ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1863    AOT_hence z(𝒜φ{z}  z = β) using "∀I" by fast
1864    moreover AOT_have 𝒜φ{β} using "&E" 0[THEN "≡E"(2)] 1 by blast
1865    ultimately AOT_show 𝒜φ{β} & z(𝒜φ{z}  z = β) using "&I" by blast
1866  qed
1867  also AOT_have ...  β = ιx ψ{x}
1868    using "Commutativity of ≡"[THEN "≡E"(1)] "nec-hintikka-scheme" by blast
1869  finally AOT_show β = ιx φ{x}  β = ιx ψ{x} .
1870qed
1871
1872AOT_theorem "equiv-desc-eq:2": ιx φ{x} & 𝒜x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1873proof(rule "→I")
1874  AOT_assume ιx φ{x} & 𝒜x(φ{x}  ψ{x})
1875  AOT_hence 0: y (y = ιx φ{x}) and
1876            1: x (x = ιx φ{x}  x = ιx ψ{x})
1877    using "&E" "free-thms:1"[THEN "≡E"(1)] "equiv-desc-eq:1" "→E" by blast+
1878  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1879  moreover AOT_have a = ιx ψ{x} using calculation 1 "∀E" "≡E"(1) by fast
1880  ultimately AOT_show ιx φ{x} = ιx ψ{x}
1881    using "rule=E" by fast
1882qed
1883
1884AOT_theorem "equiv-desc-eq:3": ιx φ{x} & x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1885  using "→I" "equiv-desc-eq:2"[THEN "→E", OF "&I"] "&E" "nec-imp-act"[THEN "→E"] by metis
1886
1887(* Note: this is a special case of "exist-nec" *)
1888AOT_theorem "equiv-desc-eq:4": ιx φ{x}  ιx φ{x}
1889proof(rule "→I")
1890  AOT_assume ιx φ{x}
1891  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1892  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1893  AOT_thus ιx φ{x}
1894    using "ex:2:a" "rule=E" by fast
1895qed
1896
1897AOT_theorem "equiv-desc-eq:5": ιx φ{x}  y (y = ιx φ{x})
1898proof(rule "→I")
1899  AOT_assume ιx φ{x}
1900  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1901  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1902  AOT_hence (a = ιx φ{x}) by (metis "id-nec:2" "vdash-properties:10")
1903  AOT_thus y (y = ιx φ{x}) by (rule "∃I")
1904qed
1905
1906AOT_act_theorem "equiv-desc-eq2:1": x (φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1907  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:1"[THEN "→E"]
1908        "RA[1]" "deduction-theorem" by blast
1909
1910AOT_act_theorem "equiv-desc-eq2:2": ιx φ{x} & x (φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1911  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:2"[THEN "→E", OF "&I"]
1912        "RA[1]" "deduction-theorem" "&E" by metis
1913
1914context russel_axiom
1915begin
1916AOT_theorem "nec-russell-axiom": ψ{ιx φ{x}}  x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1917proof -
1918  AOT_have b: x (x = ιx φ{x}  (𝒜φ{x} & z(𝒜φ{z}  z = x)))
1919    using "nec-hintikka-scheme" "∀I" by fast
1920  show ?thesis
1921  proof(rule "≡I"; rule "→I")
1922    AOT_assume c: ψ{ιx φ{x}}
1923    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1924    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1925    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1926    moreover AOT_have a = ιx φ{x}  (𝒜φ{a} & z(𝒜φ{z}  z = a)) using b "∀E" by blast
1927    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) using "≡E" by blast
1928    moreover AOT_have ψ{a}
1929    proof - 
1930      AOT_have 1: xy(x = y  y = x)
1931        by (simp add: "id-eq:2" "universal-cor")
1932      AOT_have a = ιx φ{x}   ιx φ{x} = a
1933        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1934           (auto simp: d "universal-cor" 1)
1935      AOT_thus ψ{a}
1936        using a_def c "rule=E" "→E" by metis
1937    qed
1938    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) & ψ{a} by (rule "&I")
1939    AOT_thus x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x}) by (rule "∃I")
1940  next
1941    AOT_assume x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1942    then AOT_obtain b where g: 𝒜φ{b} & z(𝒜φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1943    AOT_hence h: b = ιx φ{x}  (𝒜φ{b} & z(𝒜φ{z}  z = b)) using b "∀E" by blast
1944    AOT_have 𝒜φ{b} & z(𝒜φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1945    AOT_hence b = ιx φ{x} using h "≡E" by blast
1946    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1947  qed
1948qed
1949end
1950
1951AOT_theorem "actual-desc:1": ιx φ{x}  ∃!x 𝒜φ{x}
1952proof (rule "≡I"; rule "→I")
1953  AOT_assume ιx φ{x}
1954  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1955  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1956  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1957    using descriptions[axiom_inst] by blast
1958  ultimately AOT_have z(𝒜φ{z}  z = a)
1959    using "≡E" by blast
1960  AOT_hence xz(𝒜φ{z}  z = x) by (rule "∃I")
1961  AOT_thus ∃!x 𝒜φ{x}
1962    using "uniqueness:2"[THEN "≡E"(2)] by fast
1963next
1964  AOT_assume ∃!x 𝒜φ{x}
1965  AOT_hence xz(𝒜φ{z}  z = x)
1966    using "uniqueness:2"[THEN "≡E"(1)] by fast
1967  then AOT_obtain a where z(𝒜φ{z}  z = a) using "instantiation"[rotated] by blast
1968  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1969    using descriptions[axiom_inst] by blast
1970  ultimately AOT_have a = ιx φ{x} using "≡E" by blast
1971  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1972qed
1973
1974AOT_theorem "actual-desc:2": x = ιx φ{x}  𝒜φ{x}
1975  using "&E"(1) "contraposition:1[2]" "≡E"(1) "nec-hintikka-scheme" "reductio-aa:2" "vdash-properties:9" by blast
1976
1977AOT_theorem "actual-desc:3": z = ιx φ{x}  𝒜φ{z}
1978  using "actual-desc:2". (* TODO: same as above *)
1979
1980AOT_theorem "actual-desc:4": ιx φ{x}  𝒜φ{ιx φ{x}}
1981proof(rule "→I")
1982  AOT_assume ιx φ{x}
1983  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1984  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1985  AOT_thus 𝒜φ{ιx φ{x}}
1986    using "actual-desc:2" "rule=E" "→E" by fast
1987qed
1988
1989(* TODO: take another look at proof in PLM *)
1990AOT_theorem "actual-desc:5": ιx φ{x} = ιx ψ{x}  𝒜x(φ{x}  ψ{x})
1991proof(rule "→I")
1992  AOT_assume 0: ιx φ{x} = ιx ψ{x}
1993  AOT_hence φ_down: ιx φ{x} and ψ_down: ιx ψ{x}
1994    using "t=t-proper:1" "t=t-proper:2" "vdash-properties:6" by blast+
1995  AOT_hence y (y = ιx φ{x}) and y (y = ιx ψ{x}) by (metis "rule=I:1" "existential:1")+
1996  then AOT_obtain a and b where a_eq: a = ιx φ{x} and b_eq: b = ιx ψ{x}
1997    using "instantiation"[rotated] by metis
1998
1999  AOT_have αβ (α = β  β = α) by (rule "∀I"; rule "∀I"; rule "id-eq:2")
2000  AOT_hence β (ιx φ{x} = β  β = ιx φ{x})
2001    using "∀E" φ_down by blast
2002  AOT_hence ιx φ{x} = ιx ψ{x}  ιx ψ{x} = ιx φ{x}
2003    using "∀E" ψ_down by blast
2004  AOT_hence 1: ιx ψ{x} = ιx φ{x} using 0
2005    "→E" by blast
2006
2007  AOT_have 𝒜φ{x}  𝒜ψ{x} for x
2008  proof(rule "≡I"; rule "→I")
2009    AOT_assume 𝒜φ{x}
2010    moreover AOT_have 𝒜φ{x}  x = a for x
2011      using "nec-hintikka-scheme"[THEN "≡E"(1), OF a_eq, THEN "&E"(2)] "∀E" by blast
2012    ultimately AOT_have x = a using "→E" by blast
2013    AOT_hence x = ιx φ{x} using a_eq "rule=E" by blast
2014    AOT_hence x = ιx ψ{x} using 0 "rule=E" by blast
2015    AOT_thus 𝒜ψ{x} by (metis "actual-desc:3" "vdash-properties:6")
2016  next
2017    AOT_assume 𝒜ψ{x}
2018    moreover AOT_have 𝒜ψ{x}  x = b for x
2019      using "nec-hintikka-scheme"[THEN "≡E"(1), OF b_eq, THEN "&E"(2)] "∀E" by blast
2020    ultimately AOT_have x = b using "→E" by blast
2021    AOT_hence x = ιx ψ{x} using b_eq "rule=E" by blast
2022    AOT_hence x = ιx φ{x} using 1 "rule=E" by blast
2023    AOT_thus 𝒜φ{x} by (metis "actual-desc:3" "vdash-properties:6")
2024  qed
2025  AOT_hence 𝒜(φ{x}  ψ{x}) for x by (metis "Act-Basic:5" "≡E"(2))
2026  AOT_hence x 𝒜(φ{x}  ψ{x}) by (rule "∀I")
2027  AOT_thus 𝒜x (φ{x}  ψ{x})
2028    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
2029qed    
2030
2031AOT_theorem "!box-desc:1": ∃!x φ{x}  y (y = ιx φ{x}  φ{y})
2032proof(rule "→I")
2033  AOT_assume ∃!x φ{x}
2034  AOT_hence ζ: x (φ{x} & z (φ{z}  z = x))
2035    using "uniqueness:1"[THEN "≡dfE"] by blast
2036  then AOT_obtain b where θ: φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
2037  AOT_show y (y = ιx φ{x}  φ{y})
2038  proof(rule GEN; rule "→I")
2039    fix y
2040    AOT_assume y = ιx φ{x}
2041    AOT_hence 𝒜φ{y} & z (𝒜φ{z}  z = y) using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
2042    AOT_hence 𝒜φ{b}  b = y using "&E" "∀E" by blast
2043    moreover AOT_have 𝒜φ{b} using θ[THEN "&E"(1)]  by (metis "nec-imp-act" "→E")
2044    ultimately AOT_have b = y using "→E" by blast
2045    moreover AOT_have φ{b} using θ[THEN "&E"(1)]  by (metis "qml:2"[axiom_inst] "→E") 
2046    ultimately AOT_show φ{y} using "rule=E" by blast
2047  qed
2048qed
2049
2050AOT_theorem "!box-desc:2": x (φ{x}  φ{x})  (∃!x φ{x}  y (y = ιx φ{x}  φ{y}))
2051proof(rule "→I"; rule "→I")
2052  AOT_assume x (φ{x}  φ{x})
2053  moreover AOT_assume ∃!x φ{x}
2054  ultimately AOT_have ∃!x φ{x}
2055    using "nec-exist-!"[THEN "→E", THEN "→E"] by blast
2056  AOT_thus y (y = ιx φ{x}  φ{y})
2057    using "!box-desc:1" "→E" by blast
2058qed
2059
2060AOT_theorem "dr-alphabetic-thm": ιν φ{ν}  ιν φ{ν} = ιμ φ{μ} (* TODO: vacuous *)
2061  by (simp add: "rule=I:1" "→I")
2062
2063AOT_theorem "RM:1[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2064proof -
2065  AOT_have Γ  (φ  ψ) using "RN[prem]" assms by blast
2066  AOT_thus Γ  φ  ψ by (metis "qml:1"[axiom_inst] "→E")
2067qed
2068
2069AOT_theorem "RM:1": assumes  φ  ψ shows  φ  ψ
2070  using "RM:1[prem]" assms by blast
2071
2072lemmas RM = "RM:1"
2073
2074AOT_theorem "RM:2[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2075proof -
2076  AOT_have Γ  ¬ψ  ¬φ using assms 
2077    by (simp add: "contraposition:1[1]")
2078  AOT_hence Γ  ¬ψ  ¬φ using "RM:1[prem]" by blast
2079  AOT_thus Γ  φ  ψ
2080    by (meson "≡dfE" "≡dfI" "conventions:5" "deduction-theorem" "modus-tollens:1")
2081qed
2082
2083AOT_theorem "RM:2": assumes  φ  ψ shows  φ  ψ
2084  using "RM:2[prem]" assms by blast
2085
2086lemmas "RM◇" = "RM:2"
2087
2088AOT_theorem "RM:3[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2089proof -
2090  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2091  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:1[prem]" by metis+
2092  AOT_thus Γ  φ  ψ
2093    by (simp add: "≡I")
2094qed
2095
2096AOT_theorem "RM:3": assumes  φ  ψ shows  φ  ψ
2097  using "RM:3[prem]" assms by blast
2098
2099lemmas RE = "RM:3"
2100
2101AOT_theorem "RM:4[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2102proof -
2103  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2104  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:2[prem]" by metis+
2105  AOT_thus Γ  φ  ψ by (simp add: "≡I")
2106qed
2107
2108AOT_theorem "RM:4": assumes  φ  ψ shows  φ  ψ
2109  using "RM:4[prem]" assms by blast
2110
2111lemmas "RE◇" = "RM:4"
2112
2113AOT_theorem "KBasic:1": φ  (ψ  φ)
2114  by (simp add: RM "pl:1"[axiom_inst])
2115
2116AOT_theorem "KBasic:2": ¬φ  (φ  ψ)
2117  by (simp add: RM "useful-tautologies:3")
2118
2119AOT_theorem "KBasic:3": (φ & ψ)  (φ & ψ)
2120proof (rule "≡I"; rule "→I")
2121  AOT_assume (φ & ψ)
2122  AOT_thus φ & ψ
2123    by (meson RM "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2124next
2125  AOT_have φ  (ψ  (φ & ψ)) by (simp add: "RM:1" Adjunction)
2126  AOT_hence φ  (ψ  (φ & ψ))  by (metis "Hypothetical Syllogism" "qml:1"[axiom_inst])
2127  moreover AOT_assume φ & ψ
2128  ultimately AOT_show (φ & ψ)
2129    using "→E" "&E" by blast
2130qed
2131
2132AOT_theorem "KBasic:4": (φ  ψ)  ((φ  ψ) & (ψ  φ))
2133proof -
2134  AOT_have θ: ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2135    by (fact "KBasic:3")
2136  AOT_modally_strict {
2137    AOT_have (φ  ψ)  ((φ  ψ) & (ψ  φ))
2138      by (fact "conventions:3"[THEN "≡Df"])
2139  }
2140  AOT_hence ξ: (φ  ψ)  ((φ  ψ) & (ψ  φ))
2141    by (rule RE)
2142  with ξ and θ AOT_show (φ  ψ)  ((φ  ψ) & (ψ  φ))
2143    using "≡E"(5) by blast
2144qed
2145
2146AOT_theorem "KBasic:5": ((φ  ψ) & (ψ  φ))  (φ  ψ)
2147proof -
2148  AOT_have (φ  ψ)  (φ  ψ)
2149    by (fact "qml:1"[axiom_inst])
2150  moreover AOT_have (ψ  φ)  (ψ  φ)
2151    by (fact "qml:1"[axiom_inst])
2152  ultimately AOT_have ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2153    by (metis "&I" MP "Double Composition")
2154  moreover AOT_have ((φ  ψ) & (ψ  φ))  (φ  ψ)
2155    using "conventions:3"[THEN "≡dfI"] "→I" by blast
2156  ultimately AOT_show ((φ  ψ) & (ψ  φ))  (φ  ψ)
2157    by (metis "Hypothetical Syllogism")
2158qed
2159
2160AOT_theorem "KBasic:6": (φ ψ)  (φ  ψ)
2161  using "KBasic:4" "KBasic:5" "deduction-theorem" "≡E"(1) "vdash-properties:10" by blast
2162AOT_theorem "KBasic:7": ((φ & ψ)  (¬φ & ¬ψ))  (φ  ψ)
2163proof (rule "→I"; drule "∨E"(1); (rule "→I")?)
2164  AOT_assume φ & ψ
2165  AOT_hence φ and ψ using "&E" by blast+
2166  AOT_hence (φ  ψ) and (ψ  φ) using "KBasic:1" "→E" by blast+
2167  AOT_hence (φ  ψ) & (ψ  φ) using "&I" by blast
2168  AOT_thus (φ  ψ)  by (metis "KBasic:4" "≡E"(2))
2169next
2170  AOT_assume ¬φ & ¬ψ
2171  AOT_hence 0: (¬φ & ¬ψ) using "KBasic:3"[THEN "≡E"(2)] by blast
2172  AOT_modally_strict {
2173    AOT_have (¬φ & ¬ψ)  (φ  ψ)
2174      by (metis "&E"(1) "&E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
2175  }
2176  AOT_hence (¬φ & ¬ψ)  (φ  ψ)
2177    by (rule RM)
2178  AOT_thus (φ  ψ) using 0 "→E" by blast
2179qed(auto)
2180
2181AOT_theorem "KBasic:8": (φ & ψ)  (φ  ψ)
2182  by (meson "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I")
2183AOT_theorem "KBasic:9": (¬φ & ¬ψ)  (φ  ψ)
2184  by (metis "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I" "raa-cor:4")
2185AOT_theorem "KBasic:10": φ  ¬¬φ
2186  by (simp add: "RM:3" "oth-class-taut:3:b")
2187AOT_theorem "KBasic:11": ¬φ  ¬φ
2188proof (rule "≡I"; rule "→I")
2189  AOT_show ¬φ if ¬φ
2190    using that "≡dfI" "conventions:5" "KBasic:10" "≡E"(3) by blast
2191next
2192  AOT_show ¬φ if ¬φ
2193    using "≡dfE" "conventions:5" "KBasic:10" "≡E"(4) that by blast
2194qed
2195AOT_theorem "KBasic:12": φ  ¬¬φ
2196proof (rule "≡I"; rule "→I")
2197  AOT_show ¬¬φ if φ
2198    using "¬¬I" "KBasic:11" "≡E"(3) that by blast
2199next
2200  AOT_show φ if ¬¬φ
2201  using "KBasic:11" "≡E"(1) "reductio-aa:1" that by blast
2202qed
2203AOT_theorem "KBasic:13": (φ  ψ)  (φ  ψ)
2204proof -
2205  AOT_have φ  ψ  φ  ψ by blast
2206  AOT_hence (φ  ψ)  φ  ψ
2207    using "RM:2[prem]" by blast
2208  AOT_thus (φ  ψ)  (φ  ψ) using "→I" by blast
2209qed
2210lemmas "K◇" = "KBasic:13"
2211AOT_theorem "KBasic:14": φ  ¬¬φ
2212  by (meson "RE◇" "KBasic:11" "KBasic:12" "≡E"(6) "oth-class-taut:3:a")
2213AOT_theorem "KBasic:15": (φ  ψ)  (φ  ψ)
2214proof -
2215  AOT_modally_strict {
2216    AOT_have φ  (φ  ψ) and ψ  (φ  ψ)
2217      by (auto simp: "Disjunction Addition"(1) "Disjunction Addition"(2))
2218  }
2219  AOT_hence φ  (φ  ψ) and ψ  (φ  ψ)
2220    using RM by blast+
2221  AOT_thus (φ  ψ)  (φ  ψ)
2222    by (metis "∨E"(1) "deduction-theorem")
2223qed
2224
2225AOT_theorem "KBasic:16": (φ & ψ)  (φ & ψ)
2226  by (meson "KBasic:13" "RM:1" Adjunction "Hypothetical Syllogism" Importation "vdash-properties:6")
2227
2228AOT_theorem "rule-sub-lem:1:a":
2229  assumes  (ψ  χ)
2230  shows  ¬ψ  ¬χ
2231  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2232        "≡E"(1) "oth-class-taut:4:b" by blast
2233
2234AOT_theorem "rule-sub-lem:1:b":
2235  assumes  (ψ  χ)
2236  shows  (ψ  Θ)  (χ  Θ)
2237  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2238  using "oth-class-taut:4:c" "vdash-properties:6" by blast
2239
2240AOT_theorem "rule-sub-lem:1:c":
2241  assumes  (ψ  χ)
2242  shows  (Θ  ψ)  (Θ  χ)
2243  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2244  using "oth-class-taut:4:d" "vdash-properties:6" by blast
2245
2246AOT_theorem "rule-sub-lem:1:d":
2247  assumes for arbitrary α:  (ψ{α}  χ{α})
2248  shows  α ψ{α}  α χ{α}
2249proof -
2250  AOT_modally_strict {
2251    AOT_have α (ψ{α}  χ{α})
2252      using "qml:2"[axiom_inst, THEN "→E", OF assms] "∀I" by fast
2253    AOT_hence 0: ψ{α}  χ{α} for α using "∀E" by blast
2254    AOT_show α ψ{α}  α χ{α}
2255    proof (rule "≡I"; rule "→I")
2256      AOT_assume α ψ{α}
2257      AOT_hence ψ{α} for α using "∀E" by blast
2258      AOT_hence χ{α} for α using 0 "≡E" by blast
2259      AOT_thus α χ{α} by (rule "∀I")
2260    next
2261      AOT_assume α χ{α}
2262      AOT_hence χ{α} for α using "∀E" by blast
2263      AOT_hence ψ{α} for α using 0 "≡E" by blast
2264      AOT_thus α ψ{α} by (rule "∀I")
2265    qed
2266  }
2267qed
2268
2269AOT_theorem "rule-sub-lem:1:e":
2270  assumes  (ψ  χ)
2271  shows   ψ]   χ]
2272  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2273  using "≡E"(1) "propositions-lemma:6" by blast
2274
2275AOT_theorem "rule-sub-lem:1:f":
2276  assumes  (ψ  χ)
2277  shows  𝒜ψ  𝒜χ
2278  using "qml:2"[axiom_inst, THEN "→E", OF assms, THEN "RA[2]"]
2279  by (metis "Act-Basic:5" "≡E"(1))
2280
2281AOT_theorem "rule-sub-lem:1:g":
2282  assumes  (ψ  χ)
2283  shows  ψ  χ
2284  using "KBasic:6" assms "vdash-properties:6" by blast
2285
2286text‹Note that instead of deriving @{text "rule-sub-lem:2"}, @{text "rule-sub-lem:3"}, @{text "rule-sub-lem:4"},
2287     and @{text "rule-sub-nec"}, we construct substitution methods instead.›
2288
2289class AOT_subst =
2290  fixes AOT_subst :: "('a  𝗈)  bool"
2291    and AOT_subst_cond :: "'a  'a  bool"
2292  assumes AOT_subst: "AOT_subst φ  AOT_subst_cond ψ χ  [v  «φ ψ»  «φ χ»]"
2293
2294named_theorems AOT_substI
2295
2296instantiation 𝗈 :: AOT_subst
2297begin
2298
2299inductive AOT_subst_𝗈 where
2300  AOT_subst_𝗈_id[AOT_substI]: "AOT_subst_𝗈 (λφ. φ)"
2301| AOT_subst_𝗈_const[AOT_substI]: "AOT_subst_𝗈 (λφ. ψ)"
2302| AOT_subst_𝗈_not[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «¬Θ{φ}»)"
2303| AOT_subst_𝗈_imp[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 (λ φ. «Θ{φ}  Ξ{φ}»)"
2304| AOT_subst_𝗈_lambda0[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. (AOT_lambda0 (Θ φ)))"
2305| AOT_subst_𝗈_act[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «𝒜Θ{φ}»)"
2306| AOT_subst_𝗈_box[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «Θ{φ}»)"
2307| AOT_subst_𝗈_by_def[AOT_substI]: "( ψ . AOT_model_equiv_def (Θ ψ) (Ξ ψ))  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 Θ"
2308
2309definition AOT_subst_cond_𝗈 where "AOT_subst_cond_𝗈  λ ψ χ .  v . [v  ψ  χ]"
2310
2311instance
2312proof
2313  fix ψ χ :: 𝗈 and φ :: ‹𝗈  𝗈›
2314  assume cond: ‹AOT_subst_cond ψ χ
2315  assume ‹AOT_subst φ
2316  moreover AOT_have  ψ  χ using cond unfolding AOT_subst_cond_𝗈_def by blast
2317  ultimately AOT_show  φ{ψ}  φ{χ}
2318  proof (induct arbitrary: ψ χ)
2319    case AOT_subst_𝗈_id
2320    thus ?case using "≡E"(2) "oth-class-taut:4:b" "rule-sub-lem:1:a" by blast
2321  next
2322    case (AOT_subst_𝗈_const ψ)
2323    thus ?case by (simp add: "oth-class-taut:3:a")
2324  next
2325    case (AOT_subst_𝗈_not Θ)
2326    thus ?case by (simp add: RN "rule-sub-lem:1:a")
2327  next
2328    case (AOT_subst_𝗈_imp Θ Ξ)
2329    thus ?case by (meson RN "≡E"(5) "rule-sub-lem:1:b" "rule-sub-lem:1:c")
2330  next
2331    case (AOT_subst_𝗈_lambda0 Θ)
2332    thus ?case by (simp add: RN "rule-sub-lem:1:e")
2333  next
2334    case (AOT_subst_𝗈_act Θ)
2335    thus ?case by (simp add: RN "rule-sub-lem:1:f")
2336  next
2337    case (AOT_subst_𝗈_box Θ)
2338    thus ?case by (simp add: RN "rule-sub-lem:1:g")
2339  next
2340    case (AOT_subst_𝗈_by_def Θ Ξ)
2341    AOT_modally_strict {
2342      AOT_have Ξ{ψ}  Ξ{χ} using AOT_subst_𝗈_by_def by simp
2343      AOT_thus Θ{ψ}  Θ{χ}
2344        using "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ ψ] "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ χ]
2345        by (metis "≡E"(6) "oth-class-taut:3:a")
2346    }
2347  qed
2348qed
2349end
2350
2351instantiation "fun" :: (AOT_Term_id_2, AOT_subst) AOT_subst
2352begin
2353
2354definition AOT_subst_cond_fun :: "('a  'b)  ('a  'b)  bool" where
2355  "AOT_subst_cond_fun  λ φ ψ .  α . AOT_subst_cond (φ (AOT_term_of_var α)) (ψ (AOT_term_of_var α))"
2356
2357inductive AOT_subst_fun :: "(('a  'b)  𝗈)  bool" where
2358  AOT_subst_fun_const[AOT_substI]: "AOT_subst_fun (λφ. ψ)"
2359| AOT_subst_fun_id[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. Ψ (φ (AOT_term_of_var x)))"
2360| AOT_subst_fun_all[AOT_substI]: "AOT_subst Ψ  ( α . AOT_subst_fun (Θ (AOT_term_of_var α)))  AOT_subst_fun (λφ :: 'a  'b. Ψ «α «Θ (α::'a) φ»»)"
2361| AOT_subst_fun_not[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. «¬«Ψ φ»»)"
2362| AOT_subst_fun_imp[AOT_substI]: "AOT_subst Ψ  AOT_subst Θ  AOT_subst_fun (λφ. ««Ψ φ»  «Θ φ»»)"
2363| AOT_subst_fun_lambda0[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. (AOT_lambda0 (Θ φ)))"
2364| AOT_subst_fun_act[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. «𝒜«Θ φ»»)"
2365| AOT_subst_fun_box[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. ««Θ φ»»)"
2366| AOT_subst_fun_def[AOT_substI]: "( φ . AOT_model_equiv_def (Θ φ) (Ψ φ))  AOT_subst_fun Ψ  AOT_subst_fun Θ"
2367
2368instance proof
2369  fix ψ χ :: "'a  'b" and φ :: ('a  'b)  𝗈›
2370  assume ‹AOT_subst φ
2371  moreover assume cond: ‹AOT_subst_cond ψ χ
2372  ultimately AOT_show  «φ ψ»  «φ χ»
2373  proof(induct)
2374    case (AOT_subst_fun_const ψ)
2375    then show ?case by (simp add: "oth-class-taut:3:a")
2376  next
2377  case (AOT_subst_fun_id Ψ x)
2378  then show ?case by (simp add: AOT_subst AOT_subst_cond_fun_def) 
2379  next
2380  case (AOT_subst_fun_all Ψ Θ)
2381  AOT_have  (Θ{α, «ψ»}  Θ{α, «χ»}) for α
2382    using AOT_subst_fun_all.hyps(3) AOT_subst_fun_all.prems RN by presburger
2383  thus ?case using AOT_subst[OF AOT_subst_fun_all(1)]
2384    by (simp add: RN "rule-sub-lem:1:d" AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def)
2385  next
2386  case (AOT_subst_fun_not Ψ)
2387  then show ?case by (simp add: RN "rule-sub-lem:1:a")
2388  next
2389  case (AOT_subst_fun_imp Ψ Θ)
2390  then show ?case 
2391    unfolding AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def
2392    by (meson "≡E"(5) "oth-class-taut:4:c" "oth-class-taut:4:d" "vdash-properties:6")
2393  next
2394  case (AOT_subst_fun_lambda0 Θ)
2395  then show ?case by (simp add: RN "rule-sub-lem:1:e")
2396  next
2397  case (AOT_subst_fun_act Θ)
2398  then show ?case by (simp add: RN "rule-sub-lem:1:f")
2399  next
2400  case (AOT_subst_fun_box Θ)
2401  then show ?case by (simp add: RN "rule-sub-lem:1:g")
2402  next
2403  case (AOT_subst_fun_def Θ Ψ)
2404  then show ?case
2405    by (meson "df-rules-formulas[3]" "df-rules-formulas[4]" "≡I" "≡E"(5))
2406  qed
2407qed
2408end
2409
2410method_setup AOT_defI =
2411‹Scan.lift (Scan.succeed (fn ctxt => (Method.CONTEXT_METHOD (fn thms => (Context_Tactic.CONTEXT_SUBGOAL (fn (trm,int) => 
2412Context_Tactic.CONTEXT_TACTIC (
2413let
2414fun findHeadConst (Const x) = SOME x
2415  | findHeadConst (A $ B) = findHeadConst A
2416  | findHeadConst _ = NONE
2417fun findDef (Const (const_name‹AOT_model_equiv_def›, _) $ lhs $ rhs) = findHeadConst lhs
2418  | findDef (A $ B) = (case findDef A of SOME x => SOME x | _ => findDef B)
2419  | findDef (Abs (a,b,c)) = findDef c
2420  | findDef _ = NONE
2421val const_opt = (findDef trm)
2422val defs = case const_opt of SOME const => List.filter (fn thm => let
2423    val concl = Thm.concl_of thm
2424    val thmconst = (findDef concl)
2425    in case thmconst of SOME (c,_) => fst const = c | _ => false end) (AOT_Definitions.get ctxt)
2426    | _ => []
2427in
2428resolve_tac ctxt defs 1
2429end
2430)) 1)))))
2431‹Resolve AOT definitions›
2432
2433
2434method AOT_subst_intro_helper = ((rule AOT_substI
2435      | AOT_defI
2436      | (simp only: AOT_subst_cond_𝗈_def AOT_subst_cond_fun_def; ((rule allI)+)?)))
2437
2438method_setup AOT_subst = 2439Scan.option (Scan.lift (Args.parens (Args.$$$ "reverse"))) --
2440Scan.lift (Args.embedded_inner_syntax -- Args.embedded_inner_syntax
2441) -- Scan.option (Scan.lift (Args.$$$ "bound" -- Args.colon) |-- Scan.repeat1 (Scan.lift (Args.embedded_inner_syntax)))
2442>> (fn ((reversed,(raw_p,raw_q)),raw_bounds) => (fn ctxt =>
2443(Method.SIMPLE_METHOD (Subgoal.FOCUS (fn {context = ctxt, params = _, prems = prems, asms = asms, concl = concl, schematics = _} =>
2444let
2445val thms = prems
2446val ctxt' = ctxt
2447val ctxt = Context_Position.set_visible false ctxt
2448
2449val p = AOT_read_term @{nonterminal φ'} ctxt raw_p
2450val p = Syntax.check_term ctxt p
2451val ctxt = Variable.declare_term p ctxt
2452val q = AOT_read_term @{nonterminal φ'} ctxt raw_q
2453val q = Syntax.check_term ctxt q
2454val ctxt = Variable.declare_term q ctxt
2455
2456
2457val raw_bounds = case raw_bounds of SOME bounds => bounds | _ => [] 
2458val bounds = (map (fn x => Syntax.check_term ctxt (AOT_read_term @{nonterminal τ'} ctxt x))) raw_bounds
2459val p = fold (fn bound => fn p => let in Term.abs ("α", Term.type_of bound) (Term.abstract_over (bound,p)) end) bounds p
2460val p = Syntax.check_term ctxt p
2461val p_ty = Term.type_of p
2462
2463val pat = @{const Trueprop} $ (@{const AOT_model_valid_in} $ Var (("w",0), @{typ w}) $ (Var (("φ",0), Type (type_name‹fun›, [p_ty, @{typ 𝗈}])) $ p))
2464val univ = Unify.matchers (Context.Proof ctxt) [(pat, Thm.term_of concl)]
2465val univ = hd (Seq.list_of univ) (* TODO: choose? try all? filter? *)
2466val phi = the (Envir.lookup univ (("φ",0), Type (type_name‹fun›, [p_ty, @{typ 𝗈}])))
2467
2468val q = fold (fn bound => fn q => let in Term.abs ("α", Term.type_of bound) (Term.abstract_over (bound,q)) end) bounds q
2469val q = Syntax.check_term ctxt q
2470
2471(* Reparse to report bounds as fixes. *)
2472val ctxt = Context_Position.restore_visible ctxt' ctxt
2473val ctxt' = ctxt
2474fun unsource str = fst (Input.source_content (Syntax.read_input str))
2475val (_,ctxt') = Proof_Context.add_fixes (map (fn str => (Binding.make (unsource str, Position.none), NONE, Mixfix.NoSyn)) raw_bounds) ctxt'
2476val _ = (map (fn x => Syntax.check_term ctxt (AOT_read_term @{nonterminal τ'} ctxt' x))) raw_bounds
2477val _ = AOT_read_term @{nonterminal φ'} ctxt' raw_p
2478val _ = AOT_read_term @{nonterminal φ'} ctxt' raw_q
2479
2480val abs = phi
2481val abs = HOLogic.mk_Trueprop (@{const AOT_subst(_)} $ abs)
2482val abs = Syntax.check_term ctxt abs
2483
2484val substThm = Goal.prove ctxt [] [] abs (fn {context=ctxt, prems=prems} =>
2485      REPEAT (SUBGOAL (fn (trm,int) => let
2486          fun findHeadConst (Const x) = SOME x
2487            | findHeadConst (A $ B) = findHeadConst A
2488            | findHeadConst _ = NONE
2489          fun findDef (Const (const_name‹AOT_model_equiv_def›, _) $ lhs $ rhs) = findHeadConst lhs
2490            | findDef (A $ B) = (case findDef A of SOME x => SOME x | _ => findDef B)
2491            | findDef (Abs (a,b,c)) = findDef c
2492            | findDef _ = NONE
2493          val const_opt = (findDef trm)
2494          val defs = case const_opt of SOME const => List.filter (fn thm => let
2495              val concl = Thm.concl_of thm
2496              val thmconst = (findDef concl)
2497              in case thmconst of SOME (c,_) => fst const = c | _ => false end) (AOT_Definitions.get ctxt)
2498              | _ => []
2499          val tac = case defs of [] => safe_step_tac (ctxt addSIs @{thms AOT_substI}) 1
2500                    | _ => resolve_tac ctxt defs 1
2501        in tac end) 1)
2502  )
2503val substThm = substThm RS @{thm AOT_subst}
2504val abs = Thm.cterm_of ctxt abs
2505val substThm = case reversed of NONE =>
2506  let
2507  val substThm = Drule.instantiate_normalize ([],[((("ψ", 0), p_ty), Thm.cterm_of ctxt p),
2508          ((("χ", 0), p_ty), Thm.cterm_of ctxt q)]) substThm
2509  val substThm = substThm RS @{thm "≡E"(2)}
2510  in substThm end
2511| _ =>   let
2512  val substThm = Drule.instantiate_normalize ([],[((("χ", 0), p_ty), Thm.cterm_of ctxt p),
2513          ((("ψ", 0), p_ty), Thm.cterm_of ctxt q)]) substThm
2514  val substThm = substThm RS @{thm "≡E"(1)}
2515  in substThm end
2516
2517in
2518resolve_tac ctxt [substThm] 1
2519THEN simp_tac (ctxt addsimps [@{thm AOT_subst_cond_𝗈_def}, @{thm AOT_subst_cond_fun_def}]) 1
2520THEN (REPEAT (resolve_tac ctxt [@{thm allI}] 1))
2521THEN (TRY (resolve_tac ctxt thms 1))
2522end
2523) ctxt 1))))
2524
2525
2526method AOT_subst_old for ψ::"'a::AOT_subst" and χ::"'a::AOT_subst" =
2527    (match conclusion in "[v  «φ ψ»]" for φ and v 
2528      match (φ) in "λa . ?p" fail¦ "λa . a" fail2529       ¦ _ rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2530       ; (AOT_subst_intro_helper+)?››)
2531
2532method AOT_subst_old_rev for χ::"'a::AOT_subst" and ψ::"'a::AOT_subst" =
2533    (match conclusion in "[v  «φ ψ»]" for φ and v 
2534      match (φ) in "λa . ?p" fail¦ "λa . a" fail2535       ¦ _ rule AOT_subst[where φ=φ and ψ=χ and χ=ψ, THEN "≡E"(1)]
2536       ; (AOT_subst_intro_helper+)?››)
2537
2538method AOT_subst_manual for φ::"'a::AOT_subst  𝗈" =
2539    (rule AOT_subst[where φ=φ, THEN "≡E"(2)]; (AOT_subst_intro_helper+)?)
2540
2541method AOT_subst_manual_rev for φ::"'a::AOT_subst  𝗈" =
2542    (rule AOT_subst[where φ=φ, THEN "≡E"(1)]; (AOT_subst_intro_helper+)?)
2543
2544method AOT_subst_using uses subst =
2545    (match subst in "[?w  ψ  χ]" for ψ χ  2546       match conclusion in "[v  «φ ψ»]" for φ v 2547         rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2548         ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2549
2550method AOT_subst_using_rev uses subst =
2551    (match subst in "[?w  ψ  χ]" for ψ χ  2552      match conclusion in "[v  «φ χ»]" for φ v 2553        rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(1)]
2554        ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2555
2556AOT_theorem "rule-sub-remark:1[1]": assumes  A!x  ¬E!x and ¬A!x shows ¬¬E!x
2557  by (AOT_subst (reverse) ¬E!x A!x)
2558     (auto simp: assms) 
2559
2560AOT_theorem "rule-sub-remark:1[2]": assumes  A!x  ¬E!x and  ¬¬E!x shows ¬A!x
2561  by (AOT_subst A!x ¬E!x)
2562     (auto simp: assms)
2563
2564AOT_theorem "rule-sub-remark:2[1]":
2565  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy shows p  [R]xy & ([Q]a  ¬[Q]a)
2566  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2567
2568AOT_theorem "rule-sub-remark:2[2]":
2569  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy & ([Q]a  ¬[Q]a) shows p  [R]xy
2570  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2571
2572AOT_theorem "rule-sub-remark:3[1]":
2573  assumes for arbitrary x:  A!x  ¬E!x
2574      and x A!x
2575    shows x ¬E!x
2576  by (AOT_subst (reverse) ¬E!x A!x bound: x)
2577     (auto simp: assms)
2578
2579AOT_theorem "rule-sub-remark:3[2]":
2580  assumes for arbitrary x:  A!x  ¬E!x
2581      and x ¬E!x
2582    shows x A!x
2583  by (AOT_subst A!x ¬E!x bound: x)
2584     (auto simp: assms)
2585
2586AOT_theorem "rule-sub-remark:4[1]":
2587  assumes  ¬¬[P]x  [P]x and 𝒜¬¬[P]x shows 𝒜[P]x
2588  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2589
2590AOT_theorem "rule-sub-remark:4[2]":
2591  assumes  ¬¬[P]x  [P]x and 𝒜[P]x shows 𝒜¬¬[P]x
2592  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2593
2594AOT_theorem "rule-sub-remark:5[1]":
2595  assumes  (φ  ψ)  (¬ψ  ¬φ) and (φ  ψ) shows (¬ψ  ¬φ)
2596  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2597
2598AOT_theorem "rule-sub-remark:5[2]":
2599  assumes  (φ  ψ)  (¬ψ  ¬φ) and (¬ψ  ¬φ) shows (φ  ψ) 
2600  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2601
2602AOT_theorem "rule-sub-remark:6[1]":
2603  assumes  ψ  χ and (φ  ψ) shows (φ  χ) 
2604  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2605
2606AOT_theorem "rule-sub-remark:6[2]":
2607  assumes  ψ  χ and (φ  χ) shows (φ  ψ)
2608  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2609
2610AOT_theorem "rule-sub-remark:7[1]":
2611  assumes  φ  ¬¬φ and (φ  φ) shows (¬¬φ  φ) 
2612  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2613
2614AOT_theorem "rule-sub-remark:7[2]":
2615  assumes  φ  ¬¬φ and (¬¬φ  φ) shows  (φ  φ)
2616  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2617
2618AOT_theorem "KBasic2:1": ¬φ  ¬φ
2619  by (meson "conventions:5" "contraposition:2" "Hypothetical Syllogism" "df-rules-formulas[3]"
2620            "df-rules-formulas[4]" "≡I" "useful-tautologies:1")
2621
2622AOT_theorem "KBasic2:2": (φ  ψ)  (φ  ψ)
2623proof -
2624  AOT_have (φ  ψ)  ¬(¬φ & ¬ψ)
2625    by (simp add: "RE◇" "oth-class-taut:5:b")
2626  also AOT_have   ¬(¬φ & ¬ψ)
2627    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2628  also AOT_have   ¬(¬φ & ¬ψ)
2629    using "KBasic:3" "≡E"(1) "oth-class-taut:4:b" by blast
2630  also AOT_have   ¬(¬φ & ¬ψ)
2631    using "KBasic2:1"
2632    by (AOT_subst ¬φ ¬φ; AOT_subst ¬ψ ¬ψ; auto simp: "oth-class-taut:3:a")
2633  also AOT_have   ¬¬(φ  ψ)
2634    using "≡E"(6) "oth-class-taut:3:b" "oth-class-taut:5:b" by blast
2635  also AOT_have   φ  ψ
2636    by (simp add: "≡I" "useful-tautologies:1" "useful-tautologies:2")
2637  finally show ?thesis .
2638qed
2639
2640AOT_theorem "KBasic2:3": (φ & ψ)  (φ & ψ)
2641  by (metis "RM◇" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "deduction-theorem" "modus-tollens:1" "reductio-aa:1")
2642
2643AOT_theorem "KBasic2:4": (φ  ψ)  (φ  ψ)
2644proof -
2645  AOT_have (φ  ψ)  (¬φ  ψ)
2646    by (AOT_subst φ  ψ ¬φ  ψ)
2647       (auto simp: "oth-class-taut:1:c" "oth-class-taut:3:a")
2648  also AOT_have ...  ¬φ  ψ
2649    by (simp add: "KBasic2:2")
2650  also AOT_have ...  ¬φ  ψ
2651    by (AOT_subst ¬φ ¬φ)
2652       (auto simp: "KBasic:11" "oth-class-taut:3:a")
2653  also AOT_have ...  φ  ψ
2654    using "≡E"(6) "oth-class-taut:1:c" "oth-class-taut:3:a" by blast
2655  finally show ?thesis .
2656qed
2657
2658AOT_theorem "KBasic2:5": φ  ¬¬φ
2659  using "conventions:5"[THEN "≡Df"]
2660  by (AOT_subst φ ¬¬φ; AOT_subst ¬¬φ ¬¬¬¬φ; AOT_subst (reverse) ¬¬¬φ ¬φ)
2661     (auto simp: "oth-class-taut:3:b" "oth-class-taut:3:a")
2662
2663
2664AOT_theorem "KBasic2:6": (φ  ψ)  (φ  ψ)
2665proof(rule "→I"; rule "raa-cor:1")
2666  AOT_assume (φ  ψ)
2667  AOT_hence (¬φ  ψ)
2668    using "conventions:2"[THEN "≡Df"]
2669    by (AOT_subst (reverse) ¬φ  ψ φ  ψ) simp
2670  AOT_hence 1: ¬φ  ψ using "KBasic:13" "vdash-properties:10" by blast
2671  AOT_assume ¬(φ  ψ)
2672  AOT_hence ¬φ and ¬ψ using "&E" "≡E"(1) "oth-class-taut:5:d" by blast+
2673  AOT_thus ψ & ¬ψ using "&I"(1) 1[THEN "→E"] "KBasic:11" "≡E"(4) "raa-cor:3" by blast
2674qed
2675
2676AOT_theorem "KBasic2:7": ((φ  ψ) & ¬φ)  ψ
2677proof(rule "→I"; frule "&E"(1); drule "&E"(2))
2678  AOT_assume (φ  ψ)
2679  AOT_hence 1: φ  ψ
2680    using "KBasic2:6" "∨I"(2) "∨E"(1) by blast
2681  AOT_assume ¬φ
2682  AOT_hence ¬φ using "KBasic:11" "≡E"(2) by blast
2683  AOT_thus ψ using 1 "∨E"(2) by blast
2684qed
2685
2686AOT_theorem "T-S5-fund:1": φ  φ
2687  by (meson "≡dfI" "conventions:5" "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" "qml:2"[axiom_inst])
2688lemmas "T◇" = "T-S5-fund:1"
2689
2690AOT_theorem "T-S5-fund:2": φ  φ
2691proof(rule "→I")
2692  AOT_assume φ
2693  AOT_hence ¬¬φ
2694    using "KBasic:14" "≡E"(4) "raa-cor:3" by blast
2695  moreover AOT_have ¬φ  ¬φ
2696    by (fact "qml:3"[axiom_inst])
2697  ultimately AOT_have ¬¬φ
2698    using "modus-tollens:1" by blast
2699  AOT_thus φ using "KBasic:12" "≡E"(2) by blast
2700qed
2701lemmas "5◇" = "T-S5-fund:2"
2702
2703(* Also interestingly none of these have proofs in PLM. *)
2704AOT_theorem "Act-Sub:1": 𝒜φ  ¬𝒜¬φ
2705  by (AOT_subst 𝒜¬φ ¬𝒜φ)
2706     (auto simp: "logic-actual-nec:1"[axiom_inst] "oth-class-taut:3:b")
2707
2708AOT_theorem "Act-Sub:2": φ  𝒜φ
2709  using "conventions:5"[THEN "≡Df"]
2710  by (AOT_subst φ ¬¬φ)
2711     (metis "deduction-theorem" "≡I" "≡E"(1) "≡E"(2) "≡E"(3)
2712            "logic-actual-nec:1"[axiom_inst] "qml-act:2"[axiom_inst])
2713
2714AOT_theorem "Act-Sub:3": 𝒜φ  φ
2715  using "conventions:5"[THEN "≡Df"]
2716  by (AOT_subst φ ¬¬φ)
2717     (metis "Act-Sub:1" "deduction-theorem" "≡E"(4) "nec-imp-act" "reductio-aa:2" "→E")
2718
2719
2720AOT_theorem "Act-Sub:4": 𝒜φ  𝒜φ
2721proof (rule "≡I"; rule "→I")
2722  AOT_assume 𝒜φ
2723  AOT_thus 𝒜φ using "T◇" "vdash-properties:10" by blast
2724next
2725  AOT_assume 𝒜φ
2726  AOT_hence ¬¬𝒜φ
2727    using "≡dfE" "conventions:5" by blast
2728  AOT_hence ¬𝒜¬φ
2729    by (AOT_subst 𝒜¬φ ¬𝒜φ)
2730       (simp add: "logic-actual-nec:1"[axiom_inst])
2731  AOT_thus 𝒜φ
2732      using "Act-Basic:1" "Act-Basic:6" "∨E"(3) "≡E"(4) "reductio-aa:1" by blast
2733qed
2734
2735AOT_theorem "Act-Sub:5": 𝒜φ  𝒜φ
2736  by (metis "Act-Sub:2" "Act-Sub:3" "Act-Sub:4" "deduction-theorem" "≡E"(1) "≡E"(2) "vdash-properties:6")
2737
2738AOT_theorem "S5Basic:1": φ  φ
2739  by (simp add: "≡I" "qml:2" "qml:3" "vdash-properties:1[2]")
2740
2741AOT_theorem "S5Basic:2": φ  φ
2742  by (simp add: "T◇" "5◇" "≡I")
2743
2744AOT_theorem "S5Basic:3": φ  φ
2745  using "T◇" "Hypothetical Syllogism" "qml:3" "vdash-properties:1[2]" by blast
2746lemmas "B" = "S5Basic:3"
2747
2748AOT_theorem "S5Basic:4": φ  φ
2749  using "5◇" "Hypothetical Syllogism" "qml:2" "vdash-properties:1[2]" by blast
2750lemmas "B◇" = "S5Basic:4"
2751
2752AOT_theorem "S5Basic:5": φ  φ
2753  using "RM:1" "B" "5◇" "Hypothetical Syllogism" by blast
2754lemmas "4" = "S5Basic:5"
2755
2756AOT_theorem "S5Basic:6": φ  φ
2757  by (simp add: "4" "≡I" "qml:2"[axiom_inst])
2758
2759AOT_theorem "S5Basic:7": φ  φ
2760  using "conventions:5"[THEN "≡Df"] "oth-class-taut:3:b"
2761  by (AOT_subst φ ¬¬φ;
2762      AOT_subst φ ¬¬φ;
2763      AOT_subst (reverse) ¬¬¬φ ¬φ;
2764      AOT_subst (reverse) ¬φ ¬φ)
2765     (auto simp: "S5Basic:6" "if-p-then-p")
2766
2767lemmas "4◇" = "S5Basic:7"
2768
2769AOT_theorem "S5Basic:8": φ  φ
2770  by (simp add: "4◇" "T◇" "≡I")
2771
2772AOT_theorem "S5Basic:9": (φ  ψ)  (φ  ψ)
2773  apply (rule "≡I"; rule "→I")
2774  using "KBasic2:6" "5◇" "∨I"(3) "if-p-then-p" "vdash-properties:10" apply blast
2775  by (meson "KBasic:15" "4" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "con-dis-taut:7"
2776            "intro-elim:1" "Commutativity of ∨")
2777
2778AOT_theorem "S5Basic:10": (φ  ψ)  (φ  ψ)
2779(* Note: nicely this proof is entirely sledgehammer generated *)
2780proof(rule "≡I"; rule "→I")
2781  AOT_assume (φ  ψ)
2782  AOT_hence φ  ψ
2783    by (meson "KBasic2:6" "∨I"(2) "∨E"(1))
2784  AOT_thus φ  ψ
2785    by (meson "B◇" "4" "4◇" "T◇" "∨I"(3))
2786next
2787  AOT_assume φ  ψ
2788  AOT_hence φ  ψ
2789    by (meson "S5Basic:1" "B◇" "S5Basic:6" "T◇" "5◇" "∨I"(3) "intro-elim:1")
2790  AOT_thus (φ  ψ)
2791    by (meson "KBasic:15" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
2792qed
2793
2794AOT_theorem "S5Basic:11": (φ & ψ)  (φ & ψ)
2795proof -
2796  AOT_have (φ & ψ)  ¬(¬φ  ¬ψ)
2797    by (AOT_subst φ & ψ ¬(¬φ  ¬ψ))
2798       (auto simp: "oth-class-taut:5:a" "oth-class-taut:3:a")
2799  also AOT_have   ¬(¬φ  ¬ψ)
2800    by (AOT_subst ¬ψ ¬ψ)
2801       (auto simp: "KBasic2:1" "oth-class-taut:3:a")
2802  also AOT_have   ¬(¬φ  ¬ψ)
2803    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2804  also AOT_have   ¬(¬φ  ¬ψ)
2805    using "S5Basic:9" "≡E"(1) "oth-class-taut:4:b" by blast
2806  also AOT_have   ¬(¬φ  ¬ψ)
2807    using "KBasic2:1"
2808    by (AOT_subst ¬φ ¬φ; AOT_subst ¬ψ ¬ψ)
2809       (auto simp:  "oth-class-taut:3:a")
2810  also AOT_have   φ & ψ
2811    using "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:a" by blast
2812  finally show ?thesis .
2813qed
2814
2815AOT_theorem "S5Basic:12": (φ & ψ)  (φ & ψ)
2816proof (rule "≡I"; rule "→I")
2817  AOT_assume (φ & ψ)
2818  AOT_hence φ & ψ
2819    using "KBasic2:3" "vdash-properties:6" by blast
2820  AOT_thus φ & ψ
2821    using "5◇" "&I" "&E"(1) "&E"(2) "vdash-properties:6" by blast
2822next
2823  AOT_assume φ & ψ
2824  moreover AOT_have (ψ & φ)  (φ & ψ)
2825    by (AOT_subst φ & ψ ψ & φ)
2826       (auto simp: "Commutativity of &" "KBasic:16")
2827  ultimately AOT_show (φ & ψ)
2828    by (metis "4" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2829qed
2830
2831
2832AOT_theorem "S5Basic:13": (φ  ψ)  (φ  ψ)
2833proof (rule "≡I")
2834  AOT_modally_strict {
2835    AOT_have (φ  ψ)  (φ  ψ)
2836      by (meson "KBasic:13" "B◇" "Hypothetical Syllogism" "deduction-theorem")
2837  }
2838  AOT_hence (φ  ψ)  (φ  ψ)
2839    by (rule RM)
2840  AOT_thus  (φ  ψ)  (φ  ψ)
2841    using "4" "Hypothetical Syllogism" by blast
2842next
2843  AOT_modally_strict {
2844    AOT_have (φ  ψ)  (φ  ψ)
2845      by (meson "B" "Hypothetical Syllogism" "deduction-theorem" "qml:1" "vdash-properties:1[2]")
2846  }
2847  AOT_hence  (φ  ψ)  (φ  ψ)
2848    by (rule RM)
2849  AOT_thus (φ  ψ)  (φ  ψ)
2850    using "4" "Hypothetical Syllogism" by blast
2851qed
2852
2853AOT_theorem "derived-S5-rules:1":
2854  assumes Γ  φ  ψ shows Γ  φ  ψ
2855proof -
2856  AOT_have Γ  φ  ψ
2857    using assms by (rule "RM:1[prem]")
2858  AOT_thus Γ  φ  ψ
2859    using "B" "Hypothetical Syllogism" by blast
2860qed
2861
2862AOT_theorem "derived-S5-rules:2":
2863  assumes Γ  φ  ψ shows Γ  φ  ψ
2864proof -
2865  AOT_have Γ  φ  ψ
2866    using assms by (rule "RM:2[prem]")
2867  AOT_thus Γ  φ  ψ
2868    using "B◇" "Hypothetical Syllogism" by blast
2869qed
2870
2871AOT_theorem "BFs:1": α φ{α}  α φ{α}
2872proof -
2873  AOT_modally_strict {
2874    AOT_modally_strict {
2875      AOT_have α φ{α}  φ{α} for α by (fact AOT)
2876    }
2877    AOT_hence α φ{α}  φ{α} for α by (rule "RM◇")
2878    AOT_hence α φ{α}  α φ{α}
2879      using "B◇" "∀I" "→E" "→I" by metis
2880  }
2881  thus ?thesis using "derived-S5-rules:1" by blast
2882qed
2883lemmas "BF" = "BFs:1"
2884
2885AOT_theorem "BFs:2": α φ{α}  α φ{α}
2886proof -
2887  AOT_have α φ{α}  φ{α} for α using RM "cqt-orig:3" by metis
2888  thus ?thesis using  "cqt-orig:2"[THEN "→E"] "∀I" by metis
2889qed
2890lemmas "CBF" = "BFs:2"
2891
2892AOT_theorem "BFs:3": α φ{α}  α φ{α}
2893proof(rule "→I")
2894  AOT_modally_strict {
2895    AOT_have α ¬φ{α}  α ¬φ{α}
2896      using BF CBF "≡I" by blast
2897  } note θ = this
2898
2899  AOT_assume α φ{α}
2900  AOT_hence ¬¬(α φ{α})
2901    using "≡dfE" "conventions:5" by blast
2902  AOT_hence ¬α ¬φ{α}
2903    apply (AOT_subst α ¬φ{α} ¬(α φ{α}))
2904    using "≡dfI" "conventions:3" "conventions:4" "&I" "contraposition:2" "cqt-further:4"
2905          "df-rules-formulas[1]" "vdash-properties:1[2]" by blast
2906  AOT_hence ¬α ¬φ{α}
2907    apply (AOT_subst (reverse) α ¬φ{α} α ¬φ{α})
2908    using θ by blast
2909  AOT_hence ¬α ¬¬¬φ{α}
2910    by (AOT_subst (reverse) ¬¬¬φ{α} ¬φ{α} bound: α)
2911       (simp add: "oth-class-taut:3:b")
2912  AOT_hence α ¬¬φ{α}
2913    by (rule "conventions:4"[THEN "≡dfI"])
2914  AOT_thus α φ{α}
2915    using "conventions:5"[THEN "≡Df"]
2916    by (AOT_subst φ{α} ¬¬φ{α} bound: α)
2917qed
2918lemmas "BF◇" = "BFs:3"
2919
2920AOT_theorem "BFs:4": α φ{α}  α φ{α}
2921proof(rule "→I")
2922  AOT_assume α φ{α}
2923  AOT_hence ¬α ¬φ{α}
2924    using "conventions:4"[THEN "≡dfE"] by blast
2925  AOT_hence ¬α ¬φ{α}
2926    using "KBasic2:1"
2927    by (AOT_subst ¬φ{α} ¬φ{α} bound: α)
2928  moreover AOT_have α ¬φ{α}  α ¬φ{α}
2929    using "≡I" "BF" "CBF" by metis
2930  ultimately AOT_have 1: ¬α ¬φ{α}
2931    using "≡E"(3) by blast
2932  AOT_show α φ{α}
2933    apply (rule "conventions:5"[THEN "≡dfI"])
2934    apply (AOT_subst α φ{α} ¬α ¬φ{α})
2935     apply (simp add: "conventions:4" "≡Df")
2936    apply (AOT_subst ¬¬α ¬φ{α} α ¬φ{α})
2937    by (auto simp: 1 "≡I" "useful-tautologies:1" "useful-tautologies:2")
2938qed
2939lemmas "CBF◇" = "BFs:4"
2940
2941AOT_theorem "sign-S5-thm:1": α φ{α}  α φ{α}
2942proof(rule "→I")
2943  AOT_assume α φ{α}
2944  then AOT_obtain α where φ{α} using "∃E" by metis
2945  moreover AOT_have α
2946    by (simp add: "ex:1:a" "rule-ui:2[const_var]" RN)
2947  moreover AOT_have φ{τ}, τ  α φ{α} for τ
2948  proof -
2949    AOT_have φ{τ}, τ  α φ{α} using "existential:1" by blast
2950    AOT_thus φ{τ}, τ  α φ{α}
2951      using "RN[prem]"[where Γ="{φ τ, «τ»}", simplified] by blast
2952  qed
2953  ultimately AOT_show α φ{α} by blast
2954qed
2955lemmas Buridan = "sign-S5-thm:1"
2956
2957AOT_theorem "sign-S5-thm:2": α φ{α}  α φ{α}
2958proof -
2959  AOT_have α (α φ{α}  φ{α})
2960    by (simp add: "RM◇" "cqt-orig:3" "∀I")
2961  AOT_thus α φ{α}  α φ{α}
2962    using "∀E"(4) "∀I" "→E" "→I" by metis
2963qed
2964lemmas "Buridan◇" = "sign-S5-thm:2"
2965
2966AOT_theorem "sign-S5-thm:3": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
2967  apply (rule "RM:2")
2968  by (metis (no_types, lifting) "instantiation" "&I" "&E"(1)
2969                                "&E"(2) "deduction-theorem" "existential:2[const_var]")
2970
2971AOT_theorem "sign-S5-thm:4": α (φ{α} & ψ{α})  α φ{α}
2972  apply (rule "RM:2")
2973  by (meson "instantiation" "&E"(1) "deduction-theorem" "existential:2[const_var]")
2974
2975AOT_theorem "sign-S5-thm:5": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α (φ{α}  χ{α})
2976proof -
2977  {
2978    fix φ' ψ' χ'
2979    AOT_assume  φ' & ψ'  χ'
2980    AOT_hence φ' & ψ'  χ'
2981      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2982      using "&E" "&I" "→E" "→I" by metis
2983  } note R = this
2984  show ?thesis by (rule R; fact AOT)
2985qed
2986
2987AOT_theorem "sign-S5-thm:6": (α (φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α(φ{α}  χ{α})
2988proof -
2989  {
2990    fix φ' ψ' χ'
2991    AOT_assume  φ' & ψ'  χ'
2992    AOT_hence φ' & ψ'  χ'
2993      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2994      using "&E" "&I" "→E" "→I" by metis
2995  } note R = this
2996  show ?thesis by (rule R; fact AOT)
2997qed
2998
2999AOT_theorem "exist-nec2:1": τ  τ
3000  using "B◇" "RM◇" "Hypothetical Syllogism" "exist-nec" by blast
3001
3002AOT_theorem "exists-nec2:2": τ  τ
3003  by (meson "Act-Sub:3" "Hypothetical Syllogism" "exist-nec" "exist-nec2:1" "≡I" "nec-imp-act")
3004
3005AOT_theorem "exists-nec2:3": ¬τ  ¬τ
3006  using "KBasic2:1" "deduction-theorem" "exist-nec2:1" "≡E"(2) "modus-tollens:1" by blast
3007
3008AOT_theorem "exists-nec2:4": ¬τ  ¬τ
3009  by (metis "Act-Sub:3" "KBasic:12" "deduction-theorem" "exist-nec" "exists-nec2:3" "≡I" "≡E"(4) "nec-imp-act" "reductio-aa:1")
3010
3011AOT_theorem "id-nec2:1": α = β  α = β
3012  using "B◇" "RM◇" "Hypothetical Syllogism" "id-nec:1" by blast
3013
3014AOT_theorem "id-nec2:2": α  β  α  β
3015  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
3016  using "KBasic2:1" "deduction-theorem" "id-nec2:1" "≡E"(2) "modus-tollens:1" by blast
3017
3018AOT_theorem "id-nec2:3": α  β  α  β
3019  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
3020  by (metis "KBasic:11" "deduction-theorem" "id-nec:2" "≡E"(3) "reductio-aa:2" "vdash-properties:6")
3021
3022AOT_theorem "id-nec2:4": α = β  α = β
3023  using "Hypothetical Syllogism" "id-nec2:1" "id-nec:1" by blast
3024
3025AOT_theorem "id-nec2:5": α  β  α  β
3026  using "id-nec2:3" "id-nec2:2" "→I" "→E" by metis
3027
3028AOT_theorem "sc-eq-box-box:1": (φ  φ)  (φ  φ)
3029  apply (rule "≡I"; rule "→I")
3030  using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:10" apply blast
3031  by (metis "KBasic2:1" "KBasic:1" "KBasic:2" "S5Basic:13" "≡E"(2) "raa-cor:5" "vdash-properties:6")
3032
3033AOT_theorem "sc-eq-box-box:2": ((φ  φ)  (φ  φ))  (φ  φ)
3034  by (metis "Act-Sub:3" "KBasic:13" "5◇" "∨E"(2) "deduction-theorem" "≡I" "nec-imp-act" "raa-cor:2" "vdash-properties:10")
3035
3036AOT_theorem "sc-eq-box-box:3": (φ  φ)  (¬φ  ¬φ)
3037proof (rule "→I"; rule "≡I"; rule "→I")
3038  AOT_assume (φ  φ)
3039  AOT_hence φ  φ using "sc-eq-box-box:1" "≡E" by blast
3040  moreover AOT_assume ¬φ
3041  ultimately AOT_have ¬φ
3042    using "modus-tollens:1" by blast
3043  AOT_thus ¬φ
3044    using "KBasic2:1" "≡E"(2) by blast
3045next
3046  AOT_assume (φ  φ)
3047  moreover AOT_assume ¬φ
3048  ultimately AOT_show ¬φ
3049    using "modus-tollens:1" "qml:2" "vdash-properties:10" "vdash-properties:1[2]" by blast
3050qed
3051
3052AOT_theorem "sc-eq-box-box:4": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3053proof(rule "→I"; rule "→I")
3054  AOT_assume θ: (φ  φ) & (ψ  ψ)
3055  AOT_assume ξ: φ  ψ
3056  AOT_hence (φ & ψ)  (¬φ & ¬ψ)
3057    using "≡E"(4) "oth-class-taut:4:g" "raa-cor:3" by blast
3058  moreover {
3059    AOT_assume φ & ψ
3060    AOT_hence (φ  ψ)
3061      using "KBasic:3" "KBasic:8" "≡E"(2) "vdash-properties:10" by blast
3062  }
3063  moreover {
3064    AOT_assume ¬φ & ¬ψ
3065    moreover AOT_have ¬φ  ¬φ and ¬ψ  ¬ψ
3066      using θ "Conjunction Simplification"(1) "Conjunction Simplification"(2) "sc-eq-box-box:3" "vdash-properties:10" by metis+
3067    ultimately AOT_have ¬φ & ¬ψ
3068      by (metis "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "≡E"(4) "modus-tollens:1" "raa-cor:3")
3069    AOT_hence (φ  ψ)
3070      using "KBasic:3" "KBasic:9" "≡E"(2) "vdash-properties:10" by blast
3071  }
3072  ultimately AOT_show (φ  ψ)
3073    using "∨E"(2) "reductio-aa:1" by blast
3074qed
3075
3076AOT_theorem "sc-eq-box-box:5": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3077proof (rule "→I")
3078  AOT_assume ((φ  φ) & (ψ  ψ))
3079  AOT_hence ((φ  φ) & (ψ  ψ))
3080    using 4[THEN "→E"] "&E" "&I" "KBasic:3" "≡E"(2) by metis
3081  moreover AOT_have ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3082  proof (rule RM; rule "→I"; rule "→I")
3083    AOT_modally_strict {
3084      AOT_assume A: ((φ  φ) & (ψ  ψ))
3085      AOT_hence φ  φ and ψ  ψ
3086        using "&E" "qml:2"[axiom_inst] "→E" by blast+
3087      moreover AOT_assume φ  ψ
3088      ultimately AOT_have φ  ψ
3089        using "→E" "qml:2"[axiom_inst] "≡E" "≡I" by meson
3090      moreover AOT_have (φ  ψ)  (φ  ψ)
3091        using A "sc-eq-box-box:4" "→E" by blast
3092      ultimately AOT_show (φ  ψ) using "→E" by blast
3093    }
3094  qed
3095  ultimately AOT_show ((φ  ψ)  (φ  ψ)) using "→E" by blast
3096qed
3097
3098AOT_theorem "sc-eq-box-box:6": (φ  φ)  ((φ  ψ)  (φ  ψ))
3099proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3100  AOT_assume ¬(φ  ψ)
3101  AOT_hence ¬(φ  ψ) by (metis "KBasic:11" "≡E"(1))
3102  AOT_hence (φ & ¬ψ)
3103    by (AOT_subst φ & ¬ψ ¬(φ  ψ))
3104       (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3105  AOT_hence φ and 2: ¬ψ using "KBasic2:3"[THEN "→E"] "&E" by blast+
3106  moreover AOT_assume (φ  φ)
3107  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3108  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3109  moreover AOT_assume φ  ψ
3110  ultimately AOT_have ψ using "→E" by blast
3111  moreover AOT_have ¬ψ using 2 "KBasic:12" "¬¬I" "intro-elim:3:d" by blast
3112  ultimately AOT_show ψ & ¬ψ using "&I" by blast
3113qed
3114
3115AOT_theorem "sc-eq-box-box:7": (φ  φ)  ((φ  𝒜ψ)  𝒜(φ  ψ))
3116proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3117  AOT_assume ¬𝒜(φ  ψ)
3118  AOT_hence 𝒜¬(φ  ψ) by (metis "Act-Basic:1" "∨E"(2))
3119  AOT_hence 𝒜(φ & ¬ψ)
3120    by (AOT_subst φ & ¬ψ ¬(φ  ψ))
3121       (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3122  AOT_hence 𝒜φ and 2: 𝒜¬ψ using "Act-Basic:2"[THEN "≡E"(1)] "&E" by blast+
3123  AOT_hence φ by (metis "Act-Sub:3" "→E")
3124  moreover AOT_assume (φ  φ)
3125  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3126  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3127  moreover AOT_assume φ  𝒜ψ
3128  ultimately AOT_have 𝒜ψ using "→E" by blast
3129  moreover AOT_have ¬𝒜ψ using 2 by (meson "Act-Sub:1" "≡E"(4) "raa-cor:3")
3130  ultimately AOT_show 𝒜ψ & ¬𝒜ψ using "&I" by blast
3131qed
3132
3133AOT_theorem "sc-eq-fur:1": 𝒜φ  𝒜φ
3134  using "Act-Basic:6" "Act-Sub:4" "≡E"(6) by blast
3135
3136AOT_theorem "sc-eq-fur:2": (φ  φ)  (𝒜φ  φ)
3137  by (metis "B◇" "Act-Sub:3" "KBasic:13" "T◇" "Hypothetical Syllogism" "deduction-theorem" "≡I" "nec-imp-act")
3138
3139AOT_theorem "sc-eq-fur:3": x (φ{x}  φ{x})  (∃!x φ{x}  ιx φ{x})
3140proof (rule "→I"; rule "→I")
3141  AOT_assume x (φ{x}  φ{x})
3142  AOT_hence A: x (φ{x}  φ{x}) using CBF "→E" by blast
3143  AOT_assume ∃!x φ{x}
3144  then AOT_obtain a where a_def: φ{a} & y (φ{y}  y = a)
3145    using "∃E"[rotated 1, OF "uniqueness:1"[THEN "≡dfE"]] by blast
3146  moreover AOT_have φ{a} using calculation A "∀E"(2) "qml:2"[axiom_inst] "→E" "&E"(1) by blast
3147  AOT_hence 𝒜φ{a} using "nec-imp-act" "vdash-properties:6" by blast
3148  moreover AOT_have y (𝒜φ{y}  y = a)
3149  proof (rule "∀I"; rule "→I")
3150    fix b
3151    AOT_assume 𝒜φ{b}
3152    AOT_hence φ{b}
3153      using "Act-Sub:3" "vdash-properties:6" by blast
3154    moreover {
3155      AOT_have (φ{b}  φ{b})
3156        using A "∀E"(2) by blast
3157      AOT_hence φ{b}  φ{b}
3158        using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:6" by blast
3159    }
3160    ultimately AOT_have φ{b} using "→E" by blast
3161    AOT_hence φ{b} using "qml:2"[axiom_inst] "→E" by blast
3162    AOT_thus b = a
3163      using a_def[THEN "&E"(2)] "∀E"(2) "→E" by blast
3164  qed
3165  ultimately AOT_have 𝒜φ{a} & y (𝒜φ{y}  y = a)
3166    using "&I" by blast
3167  AOT_hence x (𝒜φ{x} & y (𝒜φ{y}  y = x)) using "∃I" by fast
3168  AOT_hence ∃!x 𝒜φ{x} using "uniqueness:1"[THEN "≡dfI"] by fast
3169  AOT_thus ιx φ{x}
3170    using "actual-desc:1"[THEN "≡E"(2)] by blast
3171qed
3172
3173AOT_theorem "sc-eq-fur:4": x (φ{x}  φ{x})  (x = ιx φ{x}  (φ{x} & z (φ{z}  z = x)))
3174proof (rule "→I")
3175  AOT_assume x (φ{x}  φ{x})
3176  AOT_hence x (φ{x}  φ{x}) using CBF "→E" by blast
3177  AOT_hence A: 𝒜φ{α}  φ{α} for α using "sc-eq-fur:2" "∀E" "→E" by fast
3178  AOT_show x = ιx φ{x}  (φ{x} & z (φ{z}  z = x))
3179  proof (rule "≡I"; rule "→I")
3180    AOT_assume x = ιx φ{x}
3181    AOT_hence B: 𝒜φ{x} & z (𝒜φ{z}  z = x)
3182      using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
3183    AOT_show φ{x} & z (φ{z}  z = x)
3184    proof (rule "&I"; (rule "∀I"; rule "→I")?)
3185      AOT_show φ{x} using A B[THEN "&E"(1)] "≡E"(1) by blast
3186    next
3187      AOT_show z = x if φ{z} for z
3188        using that B[THEN "&E"(2)] "∀E"(2) "→E" A[THEN "≡E"(2)] by blast
3189    qed
3190  next
3191    AOT_assume B: φ{x} & z (φ{z}  z = x)
3192    AOT_have 𝒜φ{x} & z (𝒜φ{z}  z = x)
3193    proof(rule "&I"; (rule "∀I"; rule "→I")?)
3194      AOT_show 𝒜φ{x} using B[THEN "&E"(1)] A[THEN "≡E"(2)] by blast
3195    next
3196      AOT_show b = x if 𝒜φ{b} for b
3197        using that A[THEN "≡E"(1)] B[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] by blast
3198    qed
3199    AOT_thus x = ιx φ{x}
3200      using "nec-hintikka-scheme"[THEN "≡E"(2)] by blast
3201  qed
3202qed
3203
3204AOT_theorem "id-act:1": α = β  𝒜α = β
3205  by (meson "Act-Sub:3" "Hypothetical Syllogism" "id-nec2:1" "id-nec:2" "≡I" "nec-imp-act")
3206
3207AOT_theorem "id-act:2": α  β  𝒜α  β
3208proof (AOT_subst α  β ¬(α = β))
3209  AOT_modally_strict {
3210    AOT_show α  β  ¬(α = β)
3211      by (simp add: "=-infix" "≡Df")
3212  }
3213next
3214  AOT_show ¬(α = β)  𝒜¬(α = β)
3215  proof (safe intro!: "≡I" "→I")
3216    AOT_assume ¬α = β
3217    AOT_hence ¬𝒜α = β using "id-act:1" "≡E"(3) by blast
3218    AOT_thus 𝒜¬α = β
3219      using "¬¬E" "Act-Sub:1" "≡E"(3) by blast
3220  next
3221    AOT_assume 𝒜¬α = β
3222    AOT_hence ¬𝒜α = β
3223      using "¬¬I" "Act-Sub:1" "≡E"(4) by blast
3224    AOT_thus ¬α = β
3225      using "id-act:1" "≡E"(4) by blast
3226  qed
3227qed
3228
3229AOT_theorem "A-Exists:1": 𝒜∃!α φ{α}  ∃!α 𝒜φ{α}
3230proof -
3231  AOT_have 𝒜∃!α φ{α}  𝒜αβ (φ{β}  β = α)
3232    by (AOT_subst_using subst: "uniqueness:2")
3233       (simp add: "oth-class-taut:3:a")
3234  also AOT_have   α 𝒜β (φ{β}  β = α)
3235    by (simp add: "Act-Basic:10")
3236  also AOT_have   αβ 𝒜(φ{β}  β = α)
3237    by (AOT_subst 𝒜β (φ{β}  β = α) β 𝒜(φ{β}  β = α) bound: α)
3238       (auto simp: "logic-actual-nec:3" "vdash-properties:1[2]" "oth-class-taut:3:a")
3239  also AOT_have   αβ (𝒜φ{β}  𝒜β = α)
3240    by (AOT_subst_old_rev "λ τ τ' . «𝒜(φ{τ'}  τ' = τ)»" "λ τ τ'. «𝒜φ{τ'}  𝒜τ' = τ»")
3241       (auto simp: "Act-Basic:5" "cqt-further:7")
3242  also AOT_have   αβ (𝒜φ{β}  β = α)
3243(*    apply (AOT_subst ‹𝒜«AOT_term_of_var β::'a» = α› ‹β = α› bound: β α) TODO: sort type constraint*)
3244    apply (AOT_subst_old "λ τ τ' :: 'a . «𝒜τ' = τ»" "λ τ τ'. «τ' = τ»")
3245     apply (meson "id-act:1" "≡E"(6) "oth-class-taut:3:a")
3246    by (simp add: "cqt-further:7")
3247  also AOT_have ...  ∃!α 𝒜φ{α}
3248    using "uniqueness:2" "Commutativity of ≡"[THEN "≡E"(1)] by fast
3249  finally show ?thesis .
3250qed
3251
3252AOT_theorem "A-Exists:2": ιx φ{x}  𝒜∃!x φ{x}
3253  by (AOT_subst_using subst: "A-Exists:1")
3254     (simp add: "actual-desc:1")
3255
3256AOT_theorem "id-act-desc:1": ιx (x = y)
3257proof(rule "existence:1"[THEN "≡dfI"]; rule "∃I")
3258  AOT_show x E!x  E!x]ιx (x = y)
3259  proof (rule "russell-axiom[exe,1].nec-russell-axiom"[THEN "≡E"(2)]; rule "∃I"; (rule "&I")+)
3260    AOT_show 𝒜y = y by (simp add: "RA[2]" "id-eq:1")
3261  next
3262    AOT_show z (𝒜z = y  z = y)
3263      apply (rule "∀I")
3264      using "id-act:1"[THEN "≡E"(2)] "→I" by blast
3265  next
3266    AOT_show x E!x  E!x]y
3267    proof (rule "lambda-predicates:2"[axiom_inst, THEN "→E", THEN "≡E"(2)])
3268      AOT_show x E!x  E!x]
3269        by "cqt:2[lambda]"
3270    next
3271      AOT_show E!y  E!y 
3272        by (simp add: "if-p-then-p")
3273    qed
3274  qed
3275next
3276  AOT_show x E!x  E!x]
3277    by "cqt:2[lambda]"
3278qed
3279
3280AOT_theorem "id-act-desc:2": y = ιx (x = y)
3281  by (rule descriptions[axiom_inst, THEN "≡E"(2)]; rule "∀I"; rule "id-act:1"[symmetric])
3282
3283AOT_theorem "pre-en-eq:1[1]": x1[F]  x1[F]
3284  by (simp add: encoding "vdash-properties:1[2]")
3285
3286AOT_theorem "pre-en-eq:1[2]": x1x2[F]  x1x2[F]
3287proof (rule "→I")
3288  AOT_assume x1x2[F]
3289  AOT_hence x1y [F]yx2] and x2y [F]x1y]
3290    using "nary-encoding[2]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3291  moreover AOT_have y [F]yx2] by "cqt:2[lambda]"
3292  moreover AOT_have y [F]x1y] by "cqt:2[lambda]"
3293  ultimately AOT_have x1y [F]yx2] and x2y [F]x1y]
3294    using encoding[axiom_inst, unvarify F] "→E" "&I" by blast+
3295  note A = this
3296  AOT_hence (x1y [F]yx2] & x2y [F]x1y])
3297    using "KBasic:3"[THEN "≡E"(2)] "&I" by blast
3298  AOT_thus x1x2[F]
3299    by (rule "nary-encoding[2]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3300qed
3301
3302AOT_theorem "pre-en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3303proof (rule "→I")
3304  AOT_assume x1x2x3[F]
3305  AOT_hence x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3306    using "nary-encoding[3]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3307  moreover AOT_have y [F]yx2x3] by "cqt:2[lambda]"
3308  moreover AOT_have y [F]x1yx3] by "cqt:2[lambda]"
3309  moreover AOT_have y [F]x1x2y] by "cqt:2[lambda]"
3310  ultimately AOT_have x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3311    using encoding[axiom_inst, unvarify F] "→E" by blast+
3312  note A = this
3313  AOT_have B: (x1y [F]yx2x3] & x2y [F]x1yx3] & x3y [F]x1x2y])
3314    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3315  AOT_thus x1x2x3[F]
3316    by (rule "nary-encoding[3]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3317qed
3318
3319AOT_theorem "pre-en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3320proof (rule "→I")
3321  AOT_assume x1x2x3x4[F]
3322  AOT_hence x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and  x4y [F]x1x2x3y]
3323    using "nary-encoding[4]"[axiom_inst, THEN "≡E"(1)] "&E" by metis+
3324  moreover AOT_have y [F]yx2x3x4] by "cqt:2[lambda]"
3325  moreover AOT_have y [F]x1yx3x4] by "cqt:2[lambda]"
3326  moreover AOT_have y [F]x1x2yx4] by "cqt:2[lambda]"
3327  moreover AOT_have y [F]x1x2x3y] by "cqt:2[lambda]"
3328  ultimately AOT_have x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and x4y [F]x1x2x3y]
3329    using "→E" encoding[axiom_inst, unvarify F] by blast+
3330  note A = this
3331  AOT_have B: (x1y [F]yx2x3x4] & x2y [F]x1yx3x4] & x3y [F]x1x2yx4] & x4y [F]x1x2x3y])
3332    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3333  AOT_thus x1x2x3x4[F]
3334    by (rule "nary-encoding[4]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3335qed
3336
3337AOT_theorem "pre-en-eq:2[1]": ¬x1[F]  ¬x1[F]
3338proof (rule "→I"; rule "raa-cor:1")
3339  AOT_assume ¬¬x1[F]
3340  AOT_hence x1[F]
3341    by (rule "conventions:5"[THEN "≡dfI"])
3342  AOT_hence x1[F]
3343    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[1]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3344  moreover AOT_assume ¬x1[F]
3345  ultimately AOT_show x1[F] & ¬x1[F] by (rule "&I")
3346qed
3347AOT_theorem "pre-en-eq:2[2]": ¬x1x2[F]  ¬x1x2[F]
3348proof (rule "→I"; rule "raa-cor:1")
3349  AOT_assume ¬¬x1x2[F]
3350  AOT_hence x1x2[F]
3351    by (rule "conventions:5"[THEN "≡dfI"])
3352  AOT_hence x1x2[F]
3353    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[2]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3354  moreover AOT_assume ¬x1x2[F]
3355  ultimately AOT_show x1x2[F] & ¬x1x2[F] by (rule "&I")
3356qed
3357
3358AOT_theorem "pre-en-eq:2[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3359proof (rule "→I"; rule "raa-cor:1")
3360  AOT_assume ¬¬x1x2x3[F]
3361  AOT_hence x1x2x3[F]
3362    by (rule "conventions:5"[THEN "≡dfI"])
3363  AOT_hence x1x2x3[F]
3364    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[3]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3365  moreover AOT_assume ¬x1x2x3[F]
3366  ultimately AOT_show x1x2x3[F] & ¬x1x2x3[F] by (rule "&I")
3367qed
3368
3369AOT_theorem "pre-en-eq:2[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3370proof (rule "→I"; rule "raa-cor:1")
3371  AOT_assume ¬¬x1x2x3x4[F]
3372  AOT_hence x1x2x3x4[F]
3373    by (rule "conventions:5"[THEN "≡dfI"])
3374  AOT_hence x1x2x3x4[F]
3375    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[4]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3376  moreover AOT_assume ¬x1x2x3x4[F]
3377  ultimately AOT_show x1x2x3x4[F] & ¬x1x2x3x4[F] by (rule "&I")
3378qed
3379
3380AOT_theorem "en-eq:1[1]": x1[F]  x1[F]
3381  using "pre-en-eq:1[1]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3382AOT_theorem "en-eq:1[2]": x1x2[F]  x1x2[F]
3383  using "pre-en-eq:1[2]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3384AOT_theorem "en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3385  using "pre-en-eq:1[3]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3386AOT_theorem "en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3387  using "pre-en-eq:1[4]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3388
3389AOT_theorem "en-eq:2[1]": x1[F]  x1[F]
3390  by (simp add: "≡I" "pre-en-eq:1[1]" "qml:2"[axiom_inst])
3391AOT_theorem "en-eq:2[2]": x1x2[F]  x1x2[F]
3392  by (simp add: "≡I" "pre-en-eq:1[2]" "qml:2"[axiom_inst])
3393AOT_theorem "en-eq:2[3]": x1x2x3[F]  x1x2x3[F]
3394  by (simp add: "≡I" "pre-en-eq:1[3]" "qml:2"[axiom_inst])
3395AOT_theorem "en-eq:2[4]": x1x2x3x4[F]  x1x2x3x4[F]
3396  by (simp add: "≡I" "pre-en-eq:1[4]" "qml:2"[axiom_inst])
3397
3398AOT_theorem "en-eq:3[1]": x1[F]  x1[F]
3399  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[1]"] "≡I" by blast
3400AOT_theorem "en-eq:3[2]": x1x2[F]  x1x2[F]
3401  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[2]"] "≡I" by blast
3402AOT_theorem "en-eq:3[3]": x1x2x3[F]  x1x2x3[F]
3403  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[3]"] "≡I" by blast
3404AOT_theorem "en-eq:3[4]": x1x2x3x4[F]  x1x2x3x4[F]
3405  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[4]"] "≡I" by blast
3406
3407AOT_theorem "en-eq:4[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3408  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3409  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[1]" by blast+
3410AOT_theorem "en-eq:4[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3411  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3412  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[2]" by blast+
3413AOT_theorem "en-eq:4[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3414  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3415  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[3]" by blast+
3416AOT_theorem "en-eq:4[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3417  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3418  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[4]" by blast+
3419
3420AOT_theorem "en-eq:5[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3421  apply (rule "≡I"; rule "→I")
3422  using "en-eq:4[1]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3423  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3424        "&I"[OF "pre-en-eq:1[1]"[THEN RN], OF "pre-en-eq:1[1]"[THEN RN]] by blast
3425AOT_theorem "en-eq:5[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3426  apply (rule "≡I"; rule "→I")
3427  using "en-eq:4[2]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3428  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3429        "&I"[OF "pre-en-eq:1[2]"[THEN RN], OF "pre-en-eq:1[2]"[THEN RN]] by blast
3430AOT_theorem "en-eq:5[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3431  apply (rule "≡I"; rule "→I")
3432  using "en-eq:4[3]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3433  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3434        "&I"[OF "pre-en-eq:1[3]"[THEN RN], OF "pre-en-eq:1[3]"[THEN RN]] by blast
3435AOT_theorem "en-eq:5[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3436  apply (rule "≡I"; rule "→I")
3437  using "en-eq:4[4]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3438  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3439        "&I"[OF "pre-en-eq:1[4]"[THEN RN], OF "pre-en-eq:1[4]"[THEN RN]] by blast
3440
3441AOT_theorem "en-eq:6[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3442  using "en-eq:5[1]"[symmetric] "en-eq:4[1]" "≡E"(5) by fast
3443AOT_theorem "en-eq:6[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3444  using "en-eq:5[2]"[symmetric] "en-eq:4[2]" "≡E"(5) by fast
3445AOT_theorem "en-eq:6[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3446  using "en-eq:5[3]"[symmetric] "en-eq:4[3]" "≡E"(5) by fast
3447AOT_theorem "en-eq:6[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3448  using "en-eq:5[4]"[symmetric] "en-eq:4[4]" "≡E"(5) by fast
3449
3450AOT_theorem "en-eq:7[1]": ¬x1[F]  ¬x1[F]
3451  using "pre-en-eq:2[1]" "qml:2"[axiom_inst] "≡I" by blast
3452AOT_theorem "en-eq:7[2]": ¬x1x2[F]  ¬x1x2[F]
3453  using "pre-en-eq:2[2]" "qml:2"[axiom_inst] "≡I" by blast
3454AOT_theorem "en-eq:7[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3455  using "pre-en-eq:2[3]" "qml:2"[axiom_inst] "≡I" by blast
3456AOT_theorem "en-eq:7[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3457  using "pre-en-eq:2[4]" "qml:2"[axiom_inst] "≡I" by blast
3458
3459AOT_theorem "en-eq:8[1]": ¬x1[F]  ¬x1[F]
3460  using "en-eq:2[1]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3461AOT_theorem "en-eq:8[2]": ¬x1x2[F]  ¬x1x2[F]
3462  using "en-eq:2[2]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3463AOT_theorem "en-eq:8[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3464  using "en-eq:2[3]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3465AOT_theorem "en-eq:8[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3466  using "en-eq:2[4]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3467
3468AOT_theorem "en-eq:9[1]": ¬x1[F]  ¬x1[F]
3469  using "en-eq:7[1]" "en-eq:8[1]" "≡E"(5) by blast
3470AOT_theorem "en-eq:9[2]": ¬x1x2[F]  ¬x1x2[F]
3471  using "en-eq:7[2]" "en-eq:8[2]" "≡E"(5) by blast
3472AOT_theorem "en-eq:9[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3473  using "en-eq:7[3]" "en-eq:8[3]" "≡E"(5) by blast
3474AOT_theorem "en-eq:9[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3475  using "en-eq:7[4]" "en-eq:8[4]" "≡E"(5) by blast
3476
3477AOT_theorem "en-eq:10[1]": 𝒜x1[F]  x1[F]
3478  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[1]" "pre-en-eq:1[1]")
3479AOT_theorem "en-eq:10[2]": 𝒜x1x2[F]  x1x2[F]
3480  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[2]" "pre-en-eq:1[2]")
3481AOT_theorem "en-eq:10[3]": 𝒜x1x2x3[F]  x1x2x3[F]
3482  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[3]" "pre-en-eq:1[3]")
3483AOT_theorem "en-eq:10[4]": 𝒜x1x2x3x4[F]  x1x2x3x4[F]
3484  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[4]" "pre-en-eq:1[4]")
3485
3486AOT_theorem "oa-facts:1": O!x  O!x
3487proof(rule "→I")
3488  AOT_modally_strict {
3489    AOT_have x E!x]x  E!x
3490      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3491  } note θ = this
3492  AOT_assume O!x
3493  AOT_hence x E!x]x
3494    by (rule "=dfE"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3495  AOT_hence E!x using θ[THEN "≡E"(1)] by blast
3496  AOT_hence 0: E!x using "qml:3"[axiom_inst, THEN "→E"] by blast
3497  AOT_have x E!x]x
3498    by (AOT_subst_using subst: θ) (simp add: 0)
3499  AOT_thus O!x
3500    by (rule "=dfI"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3501qed
3502
3503AOT_theorem "oa-facts:2": A!x  A!x
3504proof(rule "→I")
3505  AOT_modally_strict {
3506    AOT_have x ¬E!x]x  ¬E!x
3507      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3508  } note θ = this
3509  AOT_assume A!x
3510  AOT_hence x ¬E!x]x
3511    by (rule "=dfE"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3512  AOT_hence ¬E!x using θ[THEN "≡E"(1)] by blast
3513  AOT_hence ¬E!x using "KBasic2:1"[THEN "≡E"(2)] by blast
3514  AOT_hence 0: ¬E!x using "4"[THEN "→E"] by blast
3515  AOT_have 1: ¬E!x
3516    apply (AOT_subst ¬E!x ¬E!x)
3517    using "KBasic2:1"[symmetric] apply blast
3518    using 0 by blast
3519  AOT_have x ¬E!x]x
3520    by (AOT_subst_using subst: θ) (simp add: 1)
3521  AOT_thus A!x
3522    by (rule "=dfI"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3523qed
3524
3525AOT_theorem "oa-facts:3": O!x  O!x
3526  using "oa-facts:1" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3527AOT_theorem "oa-facts:4": A!x  A!x
3528  using "oa-facts:2" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3529
3530AOT_theorem "oa-facts:5": O!x  O!x
3531  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3532
3533AOT_theorem "oa-facts:6": A!x  A!x
3534  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3535
3536AOT_theorem "oa-facts:7": O!x  𝒜O!x
3537  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3538
3539AOT_theorem "oa-facts:8": A!x  𝒜A!x
3540  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3541
3542AOT_theorem "beta-C-meta": μ1...μn φ{μ1...μn, ν1...νn}]  (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3543  using "lambda-predicates:2"[axiom_inst] by blast
3544
3545AOT_theorem "beta-C-cor:1": (ν1...∀νn(μ1...μn φ{μ1...μn, ν1...νn}]))  ν1...∀νn (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3546  apply (rule "cqt-basic:14"[where 'a='a, THEN "→E"])
3547  using "beta-C-meta" "∀I" by fast
3548
3549AOT_theorem "beta-C-cor:2": μ1...μn φ{μ1...μn}]  ν1...∀νn (μ1...μn φ{μ1...μn}]ν1...νn  φ{ν1...νn})
3550  apply (rule "→I"; rule "∀I")
3551  using "beta-C-meta"[THEN "→E"] by fast
3552
3553(* TODO: syntax + double-check if this is really a faithful representation *)
3554theorem "beta-C-cor:3": assumes ν1νn. AOT_instance_of_cqt_2 (φ (AOT_term_of_var ν1νn))
3555  shows [v  ν1...∀νn (μ1...μn φ{ν1...νn,μ1...μn}]ν1...νn  φ{ν1...νn,ν1...νn})]
3556  using "cqt:2[lambda]"[axiom_inst, OF assms] "beta-C-cor:1"[THEN "→E"] "∀I" by fast
3557
3558AOT_theorem "betaC:1:a": μ1...μn φ{μ1...μn}]κ1...κn  φ{κ1...κn}
3559proof -
3560  AOT_modally_strict {
3561    AOT_assume μ1...μn φ{μ1...μn}]κ1...κn
3562    moreover AOT_have μ1...μn φ{μ1...μn}] and κ1...κn
3563      using calculation "cqt:5:a"[axiom_inst, THEN "→E"] "&E" by blast+
3564    ultimately AOT_show φ{κ1...κn}
3565      using "beta-C-cor:2"[THEN "→E", THEN "∀E"(1), THEN "≡E"(1)] by blast
3566  }
3567qed
3568
3569AOT_theorem "betaC:1:b": ¬φ{κ1...κn}  ¬μ1...μn φ{μ1...μn}]κ1...κn
3570  using "betaC:1:a" "raa-cor:3" by blast
3571
3572lemmas "β→C" = "betaC:1:a" "betaC:1:b"
3573
3574AOT_theorem "betaC:2:a": μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3575proof -
3576  AOT_modally_strict {
3577    AOT_assume 1: μ1...μn φ{μ1...μn}] and 2: κ1...κn and 3: φ{κ1...κn}
3578    AOT_hence μ1...μn φ{μ1...μn}]κ1...κn
3579      using "beta-C-cor:2"[THEN "→E", OF 1, THEN "∀E"(1), THEN "≡E"(2)] by blast
3580  }
3581  AOT_thus μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3582    by blast
3583qed
3584
3585AOT_theorem "betaC:2:b": μ1...μn φ{μ1...μn}], κ1...κn, ¬μ1...μn φ{μ1...μn}]κ1...κn  ¬φ{κ1...κn}
3586  using "betaC:2:a" "raa-cor:3" by blast
3587
3588lemmas "β←C" = "betaC:2:a" "betaC:2:b"
3589
3590AOT_theorem "eta-conversion-lemma1:1": Π  x1...xn [Π]x1...xn] = Π
3591  using "lambda-predicates:3"[axiom_inst] "∀I" "∀E"(1) "→I" by fast
3592
3593AOT_theorem "eta-conversion-lemma1:2": Π  ν1...νn [Π]ν1...νn] = Π
3594  using "eta-conversion-lemma1:1". (* TODO: spurious in the embedding *)
3595
3596(* match (τ) in "λa . ?b" ⇒ ‹match (τ') in "λa . ?b" ⇒ ‹fail›› ¦ _ ⇒ ‹ *)
3597
3598text‹Note: not explicitly part of PLM.›
3599AOT_theorem id_sym: assumes τ = τ' shows τ' = τ
3600  using "rule=E"[where φ="λ τ' . «τ' = τ»", rotated 1, OF assms]
3601        "=I"(1)[OF "t=t-proper:1"[THEN "→E", OF assms]] by auto
3602declare id_sym[sym]
3603
3604text‹Note: not explicitly part of PLM.›
3605AOT_theorem id_trans: assumes τ = τ' and τ' = τ'' shows τ = τ''
3606  using "rule=E" assms by blast
3607declare id_trans[trans]
3608
3609method "ηC" for Π :: <'a::{AOT_Term_id_2,AOT_κs}> = (match conclusion in "[v  τ{Π} = τ'{Π}]" for v τ τ'  3610rule "rule=E"[rotated 1, OF "eta-conversion-lemma1:2"[THEN "→E", of v "«[Π]»", symmetric]]
3611)
3612(*
3613AOT_theorem ‹[λy [λz [P]z]y → [λu [S]u]y] = [λy [P]y → [S]y]›
3614  apply ("ηC" "«[P]»") defer
3615   apply ("ηC" "«[S]»") defer
3616  oops
3617*)
3618(* TODO: proper representation of eta_conversion_lemma2 *)
3619
3620AOT_theorem "sub-des-lam:1": z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}  z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3621proof(rule "→I")
3622  AOT_assume A: z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}
3623  AOT_show z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3624    using "rule=E"[where φ="λ τ . «z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, τ}]»",
3625               OF "=I"(1)[OF A[THEN "&E"(1)]], OF A[THEN "&E"(2)]]
3626    by blast
3627qed
3628
3629AOT_theorem "sub-des-lam:2": ιx φ{x} = ιx ψ{x}  χ{ιx φ{x}} = χ{ιx ψ{x}} for χ :: ‹κ  𝗈›
3630  using "rule=E"[where φ="λ τ . «χ{ιx φ{x}} = χ{τ}»", OF "=I"(1)[OF "log-prop-prop:2"]] "→I" by blast
3631
3632AOT_theorem "prop-equiv": F = G  x (x[F]  x[G])
3633proof(rule "≡I"; rule "→I")
3634  AOT_assume F = G
3635  AOT_thus x (x[F]  x[G])
3636    by (rule "rule=E"[rotated]) (fact "oth-class-taut:3:a"[THEN GEN])
3637next
3638  AOT_assume x (x[F]  x[G])
3639  AOT_hence x[F]  x[G] for x using "∀E" by blast
3640  AOT_hence (x[F]  x[G]) for x using "en-eq:6[1]"[THEN "≡E"(1)] by blast
3641  AOT_hence x (x[F]  x[G]) by (rule GEN)
3642  AOT_hence x (x[F]  x[G]) using BF[THEN "→E"] by fast
3643  AOT_thus "F = G" using "p-identity-thm2:1"[THEN "≡E"(2)] by blast
3644qed
3645
3646AOT_theorem "relations:1":
3647  assumes INSTANCE_OF_CQT_2(φ)
3648  shows F x1...∀xn ([F]x1...xn  φ{x1...xn})
3649  apply (rule "∃I"(1)[where τ="«x1...xn φ{x1...xn}]»"])
3650  using "cqt:2[lambda]"[OF assms, axiom_inst] "beta-C-cor:2"[THEN "→E", THEN RN] by blast+
3651
3652AOT_theorem "relations:2":
3653  assumes INSTANCE_OF_CQT_2(φ)
3654  shows F x ([F]x  φ{x})
3655  using "relations:1" assms by blast
3656
3657AOT_theorem "block-paradox:1": ¬x G (x[G] & ¬[G]x)]
3658proof(rule RAA(2))
3659  let ="λ τ. «G (τ[G] & ¬[G]τ)»"
3660  AOT_assume A: x « x»]
3661  AOT_have x (A!x & F (x[F]  F = x « x»]))
3662    using "A-objects"[axiom_inst] by fast
3663  then AOT_obtain a where ξ: A!a & F (a[F]  F = x « x»])
3664    using "∃E"[rotated] by blast
3665  AOT_show ¬x G (x[G] & ¬[G]x)]
3666  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3667    AOT_assume B: x « x»]a
3668    AOT_hence G (a[G] & ¬[G]a) using "β→C" A by blast
3669    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3670    moreover AOT_have P = x « x»]
3671      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3672    ultimately AOT_have ¬x « x»]a
3673      using "rule=E" "&E"(2) by fast
3674    AOT_thus ¬x G (x[G] & ¬[G]x)] using B RAA by blast
3675  next
3676    AOT_assume B: ¬x « x»]a
3677    AOT_hence ¬G (a[G] & ¬[G]a) using "β←C" "cqt:2[const_var]"[of a, axiom_inst] A by blast
3678    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3679    AOT_have G (a[G]  [G]a)
3680      by (AOT_subst a[G]  [G]a ¬(a[G] & ¬[G]a) bound: G)
3681         (auto simp: "oth-class-taut:1:a" C)
3682    AOT_hence ax « x»]  x « x»]a using "∀E" A by blast
3683    moreover AOT_have ax « x»] using ξ[THEN "&E"(2), THEN "∀E"(1), OF A, THEN "≡E"(2)]
3684      using "=I"(1)[OF A] by blast
3685    ultimately AOT_show ¬x G (x[G] & ¬[G]x)] using B "→E" RAA by blast
3686  qed
3687qed(simp)
3688
3689AOT_theorem "block-paradox:2": ¬F x([F]x  G(x[G] & ¬[G]x))
3690proof(rule RAA(2))
3691  AOT_assume F x ([F]x  G (x[G] & ¬[G]x))
3692  then AOT_obtain F where F_prop: x ([F]x  G (x[G] & ¬[G]x)) using "∃E"[rotated] by blast
3693  AOT_have x (A!x & G (x[G]  G = F))
3694    using "A-objects"[axiom_inst] by fast
3695  then AOT_obtain a where ξ: A!a & G (a[G]  G = F)
3696    using "∃E"[rotated] by blast
3697  AOT_show ¬F x([F]x  G(x[G] & ¬[G]x))
3698  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3699    AOT_assume B: [F]a
3700    AOT_hence G (a[G] & ¬[G]a) using F_prop[THEN "∀E"(2), THEN "≡E"(1)] by blast
3701    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3702    moreover AOT_have P = F
3703      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3704    ultimately AOT_have ¬[F]a
3705      using "rule=E" "&E"(2) by fast
3706    AOT_thus ¬F x([F]x  G(x[G] & ¬[G]x)) using B RAA by blast
3707  next
3708    AOT_assume B: ¬[F]a
3709    AOT_hence ¬G (a[G] & ¬[G]a)
3710      using "oth-class-taut:4:b"[THEN "≡E"(1), OF F_prop[THEN "∀E"(2)[of _ _ a]], THEN "≡E"(1)] by simp
3711    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3712    AOT_have G (a[G]  [G]a)
3713      by (AOT_subst a[G]  [G]a ¬(a[G] & ¬[G]a) bound: G)
3714         (auto simp: "oth-class-taut:1:a" C)
3715    AOT_hence a[F]  [F]a using "∀E" by blast
3716    moreover AOT_have a[F] using ξ[THEN "&E"(2), THEN "∀E"(2), of F, THEN "≡E"(2)]
3717      using "=I"(2) by blast
3718    ultimately AOT_show ¬F x([F]x  G(x[G] & ¬[G]x)) using B "→E" RAA by blast
3719  qed
3720qed(simp)
3721
3722AOT_theorem "block-paradox:3": ¬y z z = y]
3723proof(rule RAA(2))
3724  AOT_assume θ: y z z = y]
3725  AOT_have x (A!x & F (x[F]  y(F = z z = y] & ¬y[F])))
3726    using "A-objects"[axiom_inst] by force
3727  then AOT_obtain a where a_prop: A!a & F (a[F]  y (F = z z = y] & ¬y[F]))
3728    using "∃E"[rotated] by blast
3729  AOT_have ζ: az z = a]  y (z z = a] = z z = y] & ¬yz z = a])
3730    using θ[THEN "∀E"(2)] a_prop[THEN "&E"(2), THEN "∀E"(1)] by blast
3731  AOT_show ¬y z z = y]
3732  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3733    AOT_assume A: az z = a]
3734    AOT_hence y (z z = a] = z z = y] & ¬yz z = a])
3735      using ζ[THEN "≡E"(1)] by blast
3736    then AOT_obtain b where b_prop: z z = a] = z z = b] & ¬bz z = a]
3737      using "∃E"[rotated] by blast
3738    moreover AOT_have a = a by (rule "=I")
3739    moreover AOT_have z z = a] using θ "∀E" by blast
3740    moreover AOT_have a using "cqt:2[const_var]"[axiom_inst] .
3741    ultimately AOT_have z z = a]a using "β←C" by blast
3742    AOT_hence z z = b]a using "rule=E" b_prop[THEN "&E"(1)] by fast
3743    AOT_hence a = b using "β→C" by blast
3744    AOT_hence bz z = a] using A "rule=E" by fast
3745    AOT_thus ¬y z z = y] using b_prop[THEN "&E"(2)] RAA by blast
3746  next
3747    AOT_assume A: ¬az z = a]
3748    AOT_hence ¬y (z z = a] = z z = y] & ¬yz z = a])
3749      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3750    AOT_hence y ¬(z z = a] = z z = y] & ¬yz z = a])
3751      using "cqt-further:4"[THEN "→E"] by blast
3752    AOT_hence ¬(z z = a] = z z = a] & ¬az z = a])
3753      using "∀E" by blast
3754    AOT_hence z z = a] = z z = a]  az z = a]
3755      by (metis "&I" "deduction-theorem" "raa-cor:4")
3756    AOT_hence az z = a] using "=I"(1) θ[THEN "∀E"(2)] "→E" by blast
3757    AOT_thus ¬y z z = y] using A RAA by blast
3758  qed
3759qed(simp)
3760
3761AOT_theorem "block-paradox:4": ¬y F x([F]x  x = y)
3762proof(rule RAA(2))
3763  AOT_assume θ: y F x([F]x  x = y)
3764  AOT_have x (A!x & F (x[F]  z (y([F]y  y = z) & ¬z[F])))
3765    using "A-objects"[axiom_inst] by force
3766  then AOT_obtain a where a_prop: A!a & F (a[F]  z (y([F]y  y = z) & ¬z[F]))
3767    using "∃E"[rotated] by blast
3768  AOT_obtain F where F_prop: x ([F]x  x = a) using θ[THEN "∀E"(2)] "∃E"[rotated] by blast
3769  AOT_have ζ: a[F]  z (y ([F]y  y = z) & ¬z[F])
3770    using a_prop[THEN "&E"(2), THEN "∀E"(2)] by blast
3771  AOT_show ¬y F x([F]x  x = y)
3772  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3773    AOT_assume A: a[F]
3774    AOT_hence z (y ([F]y  y = z) & ¬z[F])
3775      using ζ[THEN "≡E"(1)] by blast
3776    then AOT_obtain b where b_prop: y ([F]y  y = b) & ¬b[F]
3777      using "∃E"[rotated] by blast
3778    moreover AOT_have [F]a using F_prop[THEN "∀E"(2), THEN "≡E"(2)] "=I"(2) by blast
3779    ultimately AOT_have a = b using "∀E"(2) "≡E"(1) "&E" by fast
3780    AOT_hence a = b using "β→C" by blast
3781    AOT_hence b[F] using A "rule=E" by fast
3782    AOT_thus ¬y F x([F]x  x = y) using b_prop[THEN "&E"(2)] RAA by blast
3783  next
3784    AOT_assume A: ¬a[F]
3785    AOT_hence ¬z (y ([F]y  y = z) & ¬z[F])
3786      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3787    AOT_hence z ¬(y ([F]y  y = z) & ¬z[F])
3788      using "cqt-further:4"[THEN "→E"] by blast
3789    AOT_hence ¬(y ([F]y  y = a) & ¬a[F])
3790      using "∀E" by blast
3791    AOT_hence y ([F]y  y = a)  a[F]
3792      by (metis "&I" "deduction-theorem" "raa-cor:4")
3793    AOT_hence a[F] using F_prop "→E" by blast
3794    AOT_thus ¬y F x([F]x  x = y) using A RAA by blast
3795  qed
3796qed(simp)
3797
3798AOT_theorem "block-paradox:5": ¬Fxy([F]xy  y = x)
3799proof(rule "raa-cor:2")
3800  AOT_assume Fxy([F]xy  y = x)
3801  then AOT_obtain F where F_prop: xy([F]xy  y = x) using "∃E"[rotated] by blast
3802  {
3803    fix x
3804    AOT_have 1: y([F]xy  y = x) using F_prop "∀E" by blast
3805    AOT_have 2: z [F]xz] by "cqt:2[lambda]"
3806    moreover AOT_have y(z [F]xz]y  y = x)
3807    proof(rule "∀I")
3808      fix y
3809      AOT_have z [F]xz]y  [F]xy
3810        using "beta-C-meta"[THEN "→E"] 2 by fast
3811      also AOT_have ...  y = x using 1 "∀E"
3812        by fast
3813      finally AOT_show z [F]xz]y  y = x.
3814    qed
3815    ultimately AOT_have Fy([F]y  y = x)
3816      using "∃I" by fast
3817  }
3818  AOT_hence xFy([F]y  y = x)
3819    by (rule GEN)
3820  AOT_thus xFy([F]y  y = x) & ¬xFy([F]y  y = x)
3821    using "&I" "block-paradox:4" by blast
3822qed
3823
3824AOT_act_theorem "block-paradox2:1": x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3825proof(rule "→I"; rule "raa-cor:2")
3826  AOT_assume antecedant: x [G]x
3827  AOT_have Lemma: x ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x))
3828  proof(rule GEN)
3829    fix x
3830    AOT_have A: [G]ιy (y = x & H (x[H] & ¬[H]x))  ∃!y (y = x & H (x[H] & ¬[H]x))
3831    proof(rule "≡I"; rule "→I")
3832      AOT_assume [G]ιy (y = x & H (x[H] & ¬[H]x))
3833      AOT_hence ιy (y = x & H (x[H] & ¬[H]x))
3834        using "cqt:5:a"[axiom_inst, THEN "→E", THEN "&E"(2)] by blast
3835      AOT_thus ∃!y (y = x & H (x[H] & ¬[H]x))
3836        using "1-exists:1"[THEN "≡E"(1)] by blast
3837    next
3838      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3839      AOT_obtain a where a_1: a = x & H (x[H] & ¬[H]x) and a_2: z (z = x & H (x[H] & ¬[H]x)  z = a)
3840        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3841      AOT_have a_3: [G]a
3842        using antecedant "∀E" by blast
3843      AOT_show [G]ιy (y = x & H (x[H] & ¬[H]x))
3844        apply (rule "russell-axiom[exe,1].russell-axiom"[THEN "≡E"(2)])
3845        apply (rule "∃I"(2))
3846        using a_1 a_2 a_3 "&I" by blast
3847    qed
3848    also AOT_have B: ...  H (x[H] & ¬[H]x)
3849    proof (rule "≡I"; rule "→I")
3850      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3851      AOT_obtain a where a = x & H (x[H] & ¬[H]x)
3852        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3853      AOT_thus H (x[H] & ¬[H]x) using "&E" by blast
3854    next
3855      AOT_assume H (x[H] & ¬[H]x)
3856      AOT_hence x = x & H (x[H] & ¬[H]x)
3857        using "id-eq:1" "&I" by blast
3858      moreover AOT_have z (z = x & H (x[H] & ¬[H]x)  z = x)
3859        by (simp add: "Conjunction Simplification"(1) "universal-cor")
3860      ultimately AOT_show ∃!y (y = x & H (x[H] & ¬[H]x))
3861        using "uniqueness:1"[THEN "≡dfI"] "&I" "∃I"(2) by fast
3862    qed
3863    finally AOT_show ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x)) .
3864  qed
3865
3866  AOT_assume A: x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3867  AOT_have θ: x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  [G]ιy(y = x & H (x[H] & ¬[H]x)))
3868    using "beta-C-meta"[THEN "→E", OF A] "∀I" by fast
3869  AOT_have x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  H (x[H] & ¬[H]x))
3870    using θ Lemma "cqt-basic:10"[THEN "→E"] "&I" by fast
3871  AOT_hence F x ([F]x  H (x[H] & ¬[H]x))
3872    using "∃I"(1) A by fast
3873  AOT_thus (F x ([F]x  H (x[H] & ¬[H]x))) & (¬F x ([F]x  H (x[H] & ¬[H]x)))
3874    using "block-paradox:2" "&I" by blast
3875qed
3876
3877AOT_act_theorem "block-paradox2:2": G ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3878proof(rule "∃I"(1))
3879  AOT_have 0: x p (p p)]
3880    by "cqt:2[lambda]"
3881  moreover AOT_have x x p (p p)]x
3882    apply (rule GEN)
3883    apply (rule "beta-C-cor:2"[THEN "→E", OF 0, THEN "∀E"(2), THEN "≡E"(2)])
3884    using "if-p-then-p" GEN by fast
3885  moreover AOT_have G (x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))])
3886      using "block-paradox2:1" "∀I" by fast
3887  ultimately AOT_show ¬x x p (p p)]ιy (y = x & H (x[H] & ¬[H]x))]
3888    using "∀E"(1) "→E" by blast
3889qed("cqt:2[lambda]")
3890
3891AOT_theorem propositions: p (p  φ)
3892proof(rule "∃I"(1))
3893  AOT_show (φ  φ)
3894    by (simp add: RN "oth-class-taut:3:a")
3895next
3896  AOT_show φ
3897    by (simp add: "log-prop-prop:2")
3898qed
3899
3900AOT_theorem "pos-not-equiv-ne:1": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3901proof (rule "→I")
3902  AOT_assume ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3903  AOT_hence ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3904    using "KBasic:11"[THEN "≡E"(2)] by blast
3905  AOT_hence ¬(F = G)
3906    using "id-rel-nec-equiv:1" "modus-tollens:1" by blast
3907  AOT_thus F  G
3908    using "=-infix"[THEN "≡dfI"] by blast
3909qed
3910
3911AOT_theorem "pos-not-equiv-ne:2": (¬(φ{F}  φ{G}))  F  G
3912proof (rule "→I")
3913  AOT_modally_strict {
3914    AOT_have ¬(φ{F}  φ{G})  ¬(F = G)
3915    proof (rule "→I"; rule "raa-cor:2")
3916      AOT_assume 1: F = G
3917      AOT_hence φ{F}  φ{G} using "l-identity"[axiom_inst, THEN "→E"] by blast
3918      moreover {
3919        AOT_have G = F using 1 id_sym by blast
3920        AOT_hence φ{G}  φ{F} using "l-identity"[axiom_inst, THEN "→E"] by blast
3921      }
3922      ultimately AOT_have φ{F}  φ{G} using "≡I" by blast
3923      moreover AOT_assume ¬(φ{F}  φ{G})
3924      ultimately AOT_show (φ{F}  φ{G}) & ¬(φ{F}  φ{G})
3925        using "&I" by blast
3926    qed
3927  }
3928  AOT_hence ¬(φ{F}  φ{G})  ¬(F = G)
3929    using "RM:2[prem]" by blast
3930  moreover AOT_assume ¬(φ{F}  φ{G})
3931  ultimately AOT_have 0: ¬(F = G) using "→E" by blast
3932  AOT_have (F  G)
3933    by (AOT_subst F  G ¬(F = G))
3934       (auto simp: "=-infix" "≡Df" 0)
3935  AOT_thus F  G
3936    using "id-nec2:3"[THEN "→E"] by blast
3937qed
3938
3939AOT_theorem "pos-not-equiv-ne:2[zero]": (¬(φ{p}  φ{q}))  p  q
3940proof (rule "→I")
3941  AOT_modally_strict {
3942    AOT_have ¬(φ{p}  φ{q})  ¬(p = q)
3943    proof (rule "→I"; rule "raa-cor:2")
3944      AOT_assume 1: p = q
3945      AOT_hence φ{p}  φ{q} using "l-identity"[axiom_inst, THEN "→E"] by blast
3946      moreover {
3947        AOT_have q = p using 1 id_sym by blast
3948        AOT_hence φ{q}  φ{p} using "l-identity"[axiom_inst, THEN "→E"] by blast
3949      }
3950      ultimately AOT_have φ{p}  φ{q} using "≡I" by blast
3951      moreover AOT_assume ¬(φ{p}  φ{q})
3952      ultimately AOT_show (φ{p}  φ{q}) & ¬(φ{p}  φ{q})
3953        using "&I" by blast
3954    qed
3955  }
3956  AOT_hence ¬(φ{p}  φ{q})  ¬(p = q)
3957    using "RM:2[prem]" by blast
3958  moreover AOT_assume ¬(φ{p}  φ{q})
3959  ultimately AOT_have 0: ¬(p = q) using "→E" by blast
3960  AOT_have (p  q)
3961    by (AOT_subst p  q ¬(p = q))
3962       (auto simp: 0 "=-infix" "≡Df")
3963  AOT_thus p  q
3964    using "id-nec2:3"[THEN "→E"] by blast
3965qed
3966
3967AOT_theorem "pos-not-equiv-ne:3": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3968  using "→I" "pos-not-equiv-ne:1"[THEN "→E"] "T◇"[THEN "→E"] by blast
3969
3970AOT_theorem "pos-not-equiv-ne:4": (¬(φ{F}  φ{G}))  F  G
3971  using "→I" "pos-not-equiv-ne:2"[THEN "→E"] "T◇"[THEN "→E"] by blast
3972
3973AOT_theorem "pos-not-equiv-ne:4[zero]": (¬(φ{p}  φ{q}))  p  q
3974  using "→I" "pos-not-equiv-ne:2[zero]"[THEN "→E"] "T◇"[THEN "→E"] by blast
3975
3976AOT_define relation_negation ::  Π" ("_-")
3977  "df-relation-negation": "[F]- =df x1...xn ¬[F]x1...xn]"
3978
3979nonterminal φneg
3980syntax "" :: "φneg  τ" ("_")
3981syntax "" :: "φneg  φ" ("'(_')")
3982
3983AOT_define relation_negation_0 :: ‹φ  φneg› ("'(_')-")
3984  "df-relation-negation[zero]": "(p)- =df  ¬p]"
3985
3986AOT_theorem "rel-neg-T:1": x1...xn ¬[Π]x1...xn]
3987  by "cqt:2[lambda]"
3988
3989AOT_theorem "rel-neg-T:1[zero]":  ¬φ]
3990  using "cqt:2[lambda0]"[axiom_inst] by blast
3991
3992AOT_theorem "rel-neg-T:2": [Π]- = x1...xn ¬[Π]x1...xn]
3993  using "=I"(1)[OF "rel-neg-T:1"]
3994  by (rule "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"])
3995
3996AOT_theorem "rel-neg-T:2[zero]": (φ)- =  ¬φ]
3997  using "=I"(1)[OF "rel-neg-T:1[zero]"]
3998  by (rule "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"])
3999
4000AOT_theorem "rel-neg-T:3": [Π]-
4001  using "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"] "rel-neg-T:1" by blast
4002
4003AOT_theorem "rel-neg-T:3[zero]": (φ)-
4004  using "log-prop-prop:2" by blast
4005(*  using "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"] "rel-neg-T:1[zero]" by blast *)
4006
4007(* Note: PLM states the zero place case twice *)
4008AOT_theorem "thm-relation-negation:1": [F]-x1...xn  ¬[F]x1...xn
4009proof -
4010  AOT_have [F]-x1...xn  x1...xn ¬[F]x1...xn]x1...xn
4011    using "rule=E"[rotated, OF "rel-neg-T:2"] "rule=E"[rotated, OF "rel-neg-T:2"[THEN id_sym]]
4012    "→I" "≡I" by fast
4013  also AOT_have ...  ¬[F]x1...xn
4014    using "beta-C-meta"[THEN "→E", OF "rel-neg-T:1"] by fast
4015  finally show ?thesis.
4016qed
4017
4018AOT_theorem "thm-relation-negation:2": ¬[F]-x1...xn  [F]x1...xn
4019  apply (AOT_subst [F]x1...xn ¬¬[F]x1...xn)
4020   apply (simp add: "oth-class-taut:3:b")
4021  apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4022  using "thm-relation-negation:1".
4023
4024AOT_theorem "thm-relation-negation:3": ((p)-)  ¬p
4025proof -
4026  AOT_have (p)- =  ¬p] using "rel-neg-T:2[zero]" by blast
4027  AOT_hence ((p)-)   ¬p]
4028    using "df-relation-negation[zero]" "log-prop-prop:2" "oth-class-taut:3:a" "rule-id-df:2:a" by blast
4029  also AOT_have  ¬p]  ¬p
4030    by (simp add: "propositions-lemma:2")
4031  finally show ?thesis.
4032qed
4033
4034AOT_theorem "thm-relation-negation:4": (¬((p)-))  p
4035  using "thm-relation-negation:3"[THEN "≡E"(1)]
4036        "thm-relation-negation:3"[THEN "≡E"(2)]
4037        "≡I" "→I" RAA by metis
4038
4039AOT_theorem "thm-relation-negation:5": [F]  [F]-
4040proof -
4041  AOT_have ¬([F] = [F]-)
4042  proof (rule RAA(2))
4043    AOT_show [F]x1...xn  [F]x1...xn for x1xn
4044      using "if-p-then-p".
4045  next
4046    AOT_assume [F] = [F]-
4047    AOT_hence [F]- = [F] using id_sym by blast
4048    AOT_hence [F]x1...xn  ¬[F]x1...xn for x1xn
4049      using "rule=E" "thm-relation-negation:1" by fast
4050    AOT_thus ¬([F]x1...xn  [F]x1...xn) for x1xn
4051      using "≡E" RAA by metis
4052  qed
4053  thus ?thesis
4054    using "≡dfI" "=-infix" by blast
4055qed
4056
4057AOT_theorem "thm-relation-negation:6": p  (p)-
4058proof -
4059  AOT_have ¬(p = (p)-)
4060  proof (rule RAA(2))
4061    AOT_show p  p
4062      using "if-p-then-p".
4063  next
4064    AOT_assume p = (p)-
4065    AOT_hence (p)- = p using id_sym by blast
4066    AOT_hence p  ¬p
4067      using "rule=E" "thm-relation-negation:3" by fast
4068    AOT_thus ¬(p  p)
4069      using "≡E" RAA by metis
4070  qed
4071  thus ?thesis
4072    using "≡dfI" "=-infix" by blast
4073qed
4074
4075AOT_theorem "thm-relation-negation:7": (p)- = (¬p)
4076  apply (rule "df-relation-negation[zero]"[THEN "=dfE"(1)])
4077  using "cqt:2[lambda0]"[axiom_inst] "rel-neg-T:2[zero]" "propositions-lemma:1" id_trans by blast+
4078
4079AOT_theorem "thm-relation-negation:8": p = q  (¬p) = (¬q)
4080proof(rule "→I")
4081  AOT_assume p = q
4082  moreover AOT_have (¬p) using "log-prop-prop:2".
4083  moreover AOT_have (¬p) = (¬p) using calculation(2) "=I" by blast
4084  ultimately AOT_show (¬p) = (¬q)
4085    using "rule=E" by fast
4086qed
4087
4088AOT_theorem "thm-relation-negation:9": p = q  (p)- = (q)-
4089proof(rule "→I")
4090  AOT_assume p = q
4091  AOT_hence (¬p) = (¬q) using "thm-relation-negation:8" "→E" by blast
4092  AOT_thus (p)- = (q)-
4093    using "thm-relation-negation:7" id_sym id_trans by metis
4094qed
4095
4096AOT_define Necessary :: ‹Π  φ› ("Necessary'(_')")
4097  "contingent-properties:1": Necessary([F]) df x1...∀xn [F]x1...xn
4098
4099AOT_define Necessary0 :: ‹φ  φ› ("Necessary0'(_')")
4100  "contingent-properties:1[zero]": Necessary0(p) df p
4101
4102AOT_define Impossible :: ‹Π  φ› ("Impossible'(_')")
4103  "contingent-properties:2": Impossible([F]) df F & x1...∀xn ¬[F]x1...xn
4104
4105AOT_define Impossible0 :: ‹φ  φ› ("Impossible0'(_')")
4106  "contingent-properties:2[zero]": Impossible0(p) df ¬p
4107
4108AOT_define NonContingent :: ‹Π  φ› ("NonContingent'(_')")
4109  "contingent-properties:3": NonContingent([F]) df Necessary([F])  Impossible([F])
4110
4111AOT_define NonContingent0 :: ‹φ  φ› ("NonContingent0'(_')")
4112  "contingent-properties:3[zero]": NonContingent0(p) df Necessary0(p)  Impossible0(p)
4113
4114AOT_define Contingent :: ‹Π  φ› ("Contingent'(_')")
4115  "contingent-properties:4": Contingent([F]) df F & ¬(Necessary([F])  Impossible([F]))
4116
4117AOT_define Contingent0 :: ‹φ  φ› ("Contingent0'(_')")
4118  "contingent-properties:4[zero]": Contingent0(p) df ¬(Necessary0(p)  Impossible0(p))
4119
4120
4121AOT_theorem "thm-cont-prop:1": NonContingent([F])  NonContingent([F]-)
4122proof (rule "≡I"; rule "→I")
4123  AOT_assume NonContingent([F])
4124  AOT_hence Necessary([F])  Impossible([F])
4125    using "≡dfE"[OF "contingent-properties:3"] by blast
4126  moreover {
4127    AOT_assume Necessary([F])
4128    AOT_hence (x1...∀xn [F]x1...xn)
4129      using "≡dfE"[OF "contingent-properties:1"] by blast
4130    moreover AOT_modally_strict {
4131      AOT_assume x1...∀xn [F]x1...xn
4132      AOT_hence [F]x1...xn for x1xn using "∀E" by blast
4133      AOT_hence ¬[F]-x1...xn for x1xn
4134        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:2" "≡E"(1))
4135      AOT_hence x1...∀xn ¬[F]-x1...xn using "∀I" by fast
4136    }
4137    ultimately AOT_have (x1...∀xn ¬[F]-x1...xn)
4138      using "RN[prem]"[where Γ="{«x1...∀xn [F]x1...xn»}", simplified] by blast
4139    AOT_hence Impossible([F]-)
4140      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(2)]
4141      by blast
4142  }
4143  moreover {
4144    AOT_assume Impossible([F])
4145    AOT_hence (x1...∀xn ¬[F]x1...xn)
4146      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)]
4147      by blast
4148    moreover AOT_modally_strict {
4149      AOT_assume x1...∀xn ¬[F]x1...xn
4150      AOT_hence ¬[F]x1...xn for x1xn using "∀E" by blast
4151      AOT_hence [F]-x1...xn for x1xn
4152        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(1))
4153      AOT_hence x1...∀xn [F]-x1...xn using "∀I" by fast
4154    }
4155    ultimately AOT_have (x1...∀xn [F]-x1...xn)
4156      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]x1...xn»}"] by blast
4157    AOT_hence Necessary([F]-)
4158      using "≡dfI"[OF "contingent-properties:1"] by blast
4159  }
4160  ultimately AOT_have Necessary([F]-)  Impossible([F]-)
4161    using "∨E"(1) "∨I" "→I" by metis
4162  AOT_thus NonContingent([F]-)
4163    using "≡dfI"[OF "contingent-properties:3"] by blast
4164next
4165  AOT_assume NonContingent([F]-)
4166  AOT_hence Necessary([F]-)  Impossible([F]-)
4167    using "≡dfE"[OF "contingent-properties:3"] by blast
4168  moreover {
4169    AOT_assume Necessary([F]-)
4170    AOT_hence (x1...∀xn [F]-x1...xn)
4171      using "≡dfE"[OF "contingent-properties:1"] by blast
4172    moreover AOT_modally_strict {
4173      AOT_assume x1...∀xn [F]-x1...xn
4174      AOT_hence [F]-x1...xn for x1xn using "∀E" by blast
4175      AOT_hence ¬[F]x1...xn for x1xn
4176        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(2))
4177      AOT_hence x1...∀xn ¬[F]x1...xn using "∀I" by fast
4178    }
4179    ultimately AOT_have x1...∀xn ¬[F]x1...xn
4180      using "RN[prem]"[where Γ="{«x1...∀xn [F]-x1...xn»}"] by blast
4181    AOT_hence Impossible([F])
4182      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(2)]
4183      by blast
4184  }
4185  moreover {
4186    AOT_assume Impossible([F]-)
4187    AOT_hence (x1...∀xn ¬[F]-x1...xn)
4188      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(1)]
4189      by blast
4190    moreover AOT_modally_strict {
4191      AOT_assume x1...∀xn ¬[F]-x1...xn
4192      AOT_hence ¬[F]-x1...xn for x1xn using "∀E" by blast
4193      AOT_hence [F]x1...xn for x1xn 
4194        using "thm-relation-negation:1"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4195              "useful-tautologies:1"[THEN "→E"] by blast
4196      AOT_hence x1...∀xn [F]x1...xn using "∀I" by fast
4197    }
4198    ultimately AOT_have (x1...∀xn [F]x1...xn)
4199      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]-x1...xn»}"] by blast
4200    AOT_hence Necessary([F])
4201      using "≡dfI"[OF "contingent-properties:1"] by blast
4202  }
4203  ultimately AOT_have Necessary([F])  Impossible([F])
4204    using "∨E"(1) "∨I" "→I" by metis
4205  AOT_thus NonContingent([F])
4206    using "≡dfI"[OF "contingent-properties:3"] by blast
4207qed
4208
4209AOT_theorem "thm-cont-prop:2": Contingent([F])  x [F]x & x ¬[F]x
4210proof -
4211  AOT_have Contingent([F])  ¬(Necessary([F])  Impossible([F]))
4212    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]]
4213    by blast
4214  also AOT_have ...  ¬Necessary([F]) & ¬Impossible([F])
4215    using "oth-class-taut:5:d" by fastforce
4216  also AOT_have ...  ¬Impossible([F]) & ¬Necessary([F])
4217    by (simp add: "Commutativity of &")
4218  also AOT_have ...  x [F]x & ¬Necessary([F])
4219  proof (rule "oth-class-taut:4:e"[THEN "→E"])
4220    AOT_have ¬Impossible([F])  ¬¬ x [F]x
4221      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4222      apply (AOT_subst x [F]x ¬ x ¬[F]x)
4223       apply (simp add: "conventions:4" "≡Df")
4224      apply (AOT_subst (reverse) ¬¬x ¬[F]x x ¬[F]x)
4225       apply (simp add: "oth-class-taut:3:b")
4226      using "contingent-properties:2"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]] by blast
4227    also AOT_have ...  x [F]x
4228      using "conventions:5"[THEN "≡Df", symmetric] by blast
4229    finally AOT_show ¬Impossible([F])  x [F]x .
4230  qed
4231  also AOT_have ...  x [F]x & x ¬[F]x
4232  proof (rule "oth-class-taut:4:f"[THEN "→E"])
4233    AOT_have ¬Necessary([F])  ¬¬x ¬[F]x
4234      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4235      apply (AOT_subst x ¬[F]x ¬ x ¬¬[F]x)
4236       apply (simp add: "conventions:4" "≡Df")
4237      apply (AOT_subst (reverse) ¬¬[F]x [F]x bound: x)
4238       apply (simp add: "oth-class-taut:3:b")
4239      apply (AOT_subst (reverse) ¬¬x [F]x x [F]x)
4240      by (auto simp: "oth-class-taut:3:b" "contingent-properties:1" "≡Df")
4241    also AOT_have ...  x ¬[F]x
4242      using "conventions:5"[THEN "≡Df", symmetric] by blast
4243    finally AOT_show ¬Necessary([F])  x ¬[F]x.
4244  qed
4245  finally show ?thesis.
4246qed
4247
4248AOT_theorem "thm-cont-prop:3": Contingent([F])  Contingent([F]-) for F::<κ> AOT_var›
4249proof -
4250  {
4251    fix Π :: <κ>
4252    AOT_assume Π
4253    moreover AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4254      using "thm-cont-prop:2" GEN by fast
4255    ultimately  AOT_have Contingent([Π])  x [Π]x & x ¬[Π]x
4256      using "thm-cont-prop:2" "∀E" by fast
4257  } note 1 = this
4258  AOT_have Contingent([F])  x [F]x & x ¬[F]x
4259    using "thm-cont-prop:2" by blast
4260  also AOT_have ...  x ¬[F]x & x [F]x
4261    by (simp add: "Commutativity of &")
4262  also AOT_have ...  x [F]-x & x [F]x
4263    by (AOT_subst [F]-x ¬[F]x bound: x)
4264       (auto simp: "thm-relation-negation:1" "oth-class-taut:3:a")
4265  also AOT_have ...  x [F]-x & x ¬[F]-x
4266    by (AOT_subst (reverse) [F]x ¬[F]-x bound: x)
4267       (auto simp: "thm-relation-negation:2" "oth-class-taut:3:a")
4268  also AOT_have ...  Contingent([F]-)
4269    using 1[OF "rel-neg-T:3", symmetric] by blast
4270  finally show ?thesis.
4271qed
4272
4273AOT_define concrete_if_concrete :: ‹Π› ("L")  L_def: L =df x E!x  E!x]
4274
4275AOT_theorem "thm-noncont-e-e:1": Necessary(L)
4276proof -
4277  AOT_modally_strict {
4278    fix x
4279    AOT_have x E!x  E!x] by "cqt:2[lambda]"
4280    moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4281    moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4282    ultimately AOT_have x E!x  E!x]x
4283      using "β←C" by blast
4284  }
4285  AOT_hence 0: x x E!x  E!x]x
4286    using RN GEN by blast
4287  show ?thesis
4288    apply (rule "=dfI"(2)[OF L_def])
4289     apply "cqt:2[lambda]"
4290    by (rule "contingent-properties:1"[THEN "≡dfI", OF 0])
4291qed
4292
4293AOT_theorem "thm-noncont-e-e:2": Impossible([L]-)
4294proof -
4295  AOT_modally_strict {
4296    fix x
4297
4298    AOT_have 0: F (¬[F]-x  [F]x)
4299      using "thm-relation-negation:2" GEN by fast
4300    AOT_have ¬x E!x  E!x]-x  x E!x  E!x]x
4301      by (rule 0[THEN "∀E"(1)]) "cqt:2[lambda]"
4302    moreover {
4303      AOT_have x E!x  E!x] by "cqt:2[lambda]"
4304      moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4305      moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4306      ultimately AOT_have x E!x  E!x]x
4307        using "β←C" by blast
4308    }
4309    ultimately AOT_have ¬x E!x  E!x]-x
4310      using "≡E" by blast
4311  }
4312  AOT_hence 0: x ¬x E!x  E!x]-x
4313    using RN GEN by fast
4314  show ?thesis
4315    apply (rule "=dfI"(2)[OF L_def])
4316     apply "cqt:2[lambda]"
4317    apply (rule "contingent-properties:2"[THEN "≡dfI"]; rule "&I")
4318     using "rel-neg-T:3"
4319     apply blast
4320    using 0
4321    by blast
4322qed
4323
4324AOT_theorem "thm-noncont-e-e:3": NonContingent(L)
4325  using "thm-noncont-e-e:1"
4326  by (rule "contingent-properties:3"[THEN "≡dfI", OF "∨I"(1)])
4327
4328AOT_theorem "thm-noncont-e-e:4": NonContingent([L]-)
4329proof -
4330  AOT_have 0: F (NonContingent([F])  NonContingent([F]-))
4331    using "thm-cont-prop:1" "∀I" by fast
4332  moreover AOT_have 1: L
4333    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4334  AOT_show NonContingent([L]-)
4335    using "∀E"(1)[OF 0, OF 1, THEN "≡E"(1), OF "thm-noncont-e-e:3"] by blast
4336qed
4337
4338AOT_theorem "thm-noncont-e-e:5": F G (F  «G::<κ>» & NonContingent([F]) & NonContingent([G]))
4339proof (rule "∃I")+
4340  {
4341    AOT_have F [F]  [F]- using "thm-relation-negation:5" GEN by fast
4342    moreover AOT_have L
4343      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4344    ultimately AOT_have L  [L]- using "∀E" by blast
4345  }
4346  AOT_thus L  [L]- & NonContingent(L) & NonContingent([L]-)
4347    using "thm-noncont-e-e:3" "thm-noncont-e-e:4" "&I" by metis
4348next
4349  AOT_show [L]-
4350    using "rel-neg-T:3" by blast
4351next
4352  AOT_show L
4353      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4354qed
4355
4356AOT_theorem "lem-cont-e:1": x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4357proof -
4358  AOT_have x ([F]x & ¬[F]x)  x ([F]x & ¬[F]x)
4359    using "BF◇" "CBF◇" "≡I" by blast
4360  also AOT_have   x ([F]x &  ¬[F]x)
4361    by (AOT_subst ([F]x & ¬[F]x) [F]x &  ¬[F]x bound: x)
4362       (auto simp: "S5Basic:11" "cqt-further:7")
4363  also AOT_have   x (¬[F]x & [F]x)
4364    by (AOT_subst ¬[F]x & [F]x  [F]x & ¬[F]x bound: x)
4365       (auto simp: "Commutativity of &" "cqt-further:7")
4366  also AOT_have   x (¬[F]x & [F]x)
4367    by (AOT_subst (¬[F]x & [F]x) ¬[F]x & [F]x bound: x)
4368       (auto simp: "S5Basic:11" "oth-class-taut:3:a")
4369  also AOT_have   x (¬[F]x & [F]x)
4370    using "BF◇" "CBF◇" "≡I" by fast
4371  finally show ?thesis.
4372qed
4373
4374AOT_theorem "lem-cont-e:2": x ([F]x & ¬[F]x)  x ([F]-x & ¬[F]-x)
4375proof -
4376  AOT_have x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4377    using "lem-cont-e:1".
4378  also AOT_have   x ([F]-x & ¬[F]-x)
4379    apply (AOT_subst ¬[F]-x [F]x bound: x)
4380     apply (simp add: "thm-relation-negation:2")
4381    apply (AOT_subst [F]-x ¬[F]x bound: x)
4382     apply (simp add: "thm-relation-negation:1")
4383    by (simp add: "oth-class-taut:3:a")
4384  finally show ?thesis.
4385qed
4386
4387AOT_theorem "thm-cont-e:1": x (E!x & ¬E!x)
4388proof (rule "CBF◇"[THEN "→E"])
4389  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] by blast
4390  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4391  AOT_hence θ: E!a & ¬𝒜E!a
4392    using "KBasic2:3"[THEN "→E"] by blast
4393  AOT_have ξ: E!a & 𝒜¬E!a
4394    by (AOT_subst  𝒜¬E!a ¬𝒜E!a)
4395       (auto simp: "logic-actual-nec:1"[axiom_inst] θ)
4396  AOT_have ζ: E!a & 𝒜¬E!a
4397    by (AOT_subst 𝒜¬E!a 𝒜¬E!a)
4398       (auto simp add: "Act-Sub:4" ξ)
4399  AOT_hence E!a & ¬E!a
4400    using "&E" "&I" "Act-Sub:3"[THEN "→E"] by blast
4401  AOT_hence (E!a & ¬E!a) using "S5Basic:11"[THEN "≡E"(2)] by simp
4402  AOT_thus x (E!x & ¬E!x) using "∃I"(2) by fast
4403qed
4404
4405AOT_theorem "thm-cont-e:2": x (¬E!x & E!x)
4406proof -
4407  AOT_have F (x ([F]x & ¬[F]x)  x (¬[F]x & [F]x))
4408    using "lem-cont-e:1" GEN by fast
4409  AOT_hence (x (E!x & ¬E!x)  x (¬E!x & E!x))
4410    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4411  thus ?thesis using "thm-cont-e:1" "≡E" by blast
4412qed
4413
4414AOT_theorem "thm-cont-e:3": x E!x
4415proof (rule "CBF◇"[THEN "→E"])
4416  AOT_obtain a where (E!a & ¬E!a)
4417    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4418  AOT_hence E!a
4419    using "KBasic2:3"[THEN "→E", THEN "&E"(1)] by blast
4420  AOT_thus x E!x using "∃I" by fast
4421qed
4422
4423AOT_theorem "thm-cont-e:4": x ¬E!x
4424proof (rule "CBF◇"[THEN "→E"])
4425  AOT_obtain a where (E!a & ¬E!a)
4426    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4427  AOT_hence ¬E!a
4428    using "KBasic2:3"[THEN "→E", THEN "&E"(2)] by blast
4429  AOT_hence ¬E!a
4430    using "4◇"[THEN "→E"] by blast
4431  AOT_thus x ¬E!x using "∃I" by fast
4432qed
4433
4434AOT_theorem "thm-cont-e:5": Contingent([E!])
4435proof -
4436  AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4437    using "thm-cont-prop:2" GEN by fast
4438  AOT_hence Contingent([E!])  x E!x & x ¬E!x
4439    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4440  thus ?thesis
4441    using "thm-cont-e:3" "thm-cont-e:4" "≡E"(2) "&I" by blast
4442qed
4443
4444AOT_theorem "thm-cont-e:6": Contingent([E!]-)
4445proof -
4446  AOT_have F (Contingent([«F::<κ>»])  Contingent([F]-))
4447    using "thm-cont-prop:3" GEN by fast
4448  AOT_hence Contingent([E!])  Contingent([E!]-)
4449    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4450  thus ?thesis using "thm-cont-e:5" "≡E" by blast
4451qed
4452
4453AOT_theorem "thm-cont-e:7": FG (Contingent([«F::<κ>»]) & Contingent([G]) & F  G)
4454proof (rule "∃I")+
4455  AOT_have F [«F::<κ>»]  [F]- using "thm-relation-negation:5" GEN by fast
4456  AOT_hence [E!]  [E!]-
4457    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4458  AOT_thus Contingent([E!]) & Contingent([E!]-) & [E!]  [E!]-
4459    using "thm-cont-e:5" "thm-cont-e:6" "&I" by metis
4460next
4461  AOT_show E!-
4462    by (fact AOT)
4463next
4464  AOT_show E! by (fact "cqt:2[concrete]"[axiom_inst])
4465qed
4466
4467AOT_theorem "property-facts:1": NonContingent([F])  ¬G (Contingent([G]) & G = F)
4468proof (rule "→I"; rule "raa-cor:2")
4469  AOT_assume NonContingent([F])
4470  AOT_hence 1: Necessary([F])  Impossible([F])
4471    using "contingent-properties:3"[THEN "≡dfE"] by blast
4472  AOT_assume G (Contingent([G]) & G = F)
4473  then AOT_obtain G where Contingent([G]) & G = F using "∃E"[rotated] by blast
4474  AOT_hence Contingent([F]) using "rule=E" "&E" by blast
4475  AOT_hence ¬(Necessary([F])  Impossible([F]))
4476    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4477  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4478    using 1 "&I" by blast
4479qed
4480
4481AOT_theorem "property-facts:2": Contingent([F])  ¬G (NonContingent([G]) & G = F)
4482proof (rule "→I"; rule "raa-cor:2")
4483  AOT_assume Contingent([F])
4484  AOT_hence 1: ¬(Necessary([F])  Impossible([F]))
4485    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4486  AOT_assume G (NonContingent([G]) & G = F)
4487  then AOT_obtain G where NonContingent([G]) & G = F using "∃E"[rotated] by blast
4488  AOT_hence NonContingent([F]) using "rule=E" "&E" by blast
4489  AOT_hence Necessary([F])  Impossible([F])
4490    using "contingent-properties:3"[THEN "≡dfE"] by blast
4491  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4492    using 1 "&I" by blast
4493qed
4494
4495AOT_theorem "property-facts:3": L  [L]- & L  E! & L  E!- & [L]-  [E!]- & E!  [E!]-
4496proof -
4497  AOT_have noneqI: Π  Π' if φ{Π} and ¬φ{Π'} for φ and Π Π' :: <κ>
4498    apply (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
4499    using "rule=E"[where φ=φ and τ=Π and σ = Π'] that "&I" by blast
4500  AOT_have contingent_denotes: Π if Contingent([Π]) for Π :: <κ>
4501    using that "contingent-properties:4"[THEN "≡dfE", THEN "&E"(1)] by blast
4502  AOT_have not_noncontingent_if_contingent: ¬NonContingent([Π]) if Contingent([Π]) for Π :: <κ>
4503  proof(rule RAA(2))
4504    AOT_show ¬(Necessary([Π])  Impossible([Π]))
4505      using that "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF contingent_denotes[OF that], THEN "≡E"(1)] by blast
4506  next
4507    AOT_assume NonContingent([Π])
4508    AOT_thus Necessary([Π])  Impossible([Π])
4509      using "contingent-properties:3"[THEN "≡dfE"] by blast
4510  qed
4511
4512  show ?thesis
4513  proof (safe intro!: "&I")
4514    AOT_show L  [L]-
4515      apply (rule "=dfI"(2)[OF L_def])
4516       apply "cqt:2[lambda]"
4517      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4518       apply (rule GEN) apply (fact AOT)
4519      by "cqt:2[lambda]"
4520  next
4521    AOT_show L  E!
4522      apply (rule noneqI)
4523      using "thm-noncont-e-e:3" not_noncontingent_if_contingent[OF "thm-cont-e:5"]
4524      by auto
4525  next
4526    AOT_show L  E!-
4527      apply (rule noneqI)
4528      using "thm-noncont-e-e:3" apply fast
4529      apply (rule not_noncontingent_if_contingent)
4530      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4531      using "thm-cont-prop:3" GEN apply fast
4532      using "thm-cont-e:5" by fast+
4533  next
4534    AOT_show [L]-  E!-
4535      apply (rule noneqI)
4536      using "thm-noncont-e-e:4" apply fast
4537      apply (rule not_noncontingent_if_contingent)
4538      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4539      using "thm-cont-prop:3" GEN apply fast
4540      using "thm-cont-e:5" by fast+
4541  next
4542    AOT_show E!  E!-
4543      apply (rule "=dfI"(2)[OF L_def])
4544       apply "cqt:2[lambda]"
4545      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4546       apply (rule GEN) apply (fact AOT)
4547      by (fact "cqt:2[concrete]"[axiom_inst])
4548  qed
4549qed
4550
4551AOT_theorem "thm-cont-propos:1": NonContingent0(p)  NonContingent0(((p)-))
4552proof(rule "≡I"; rule "→I")
4553  AOT_assume NonContingent0(p)
4554  AOT_hence Necessary0(p)  Impossible0(p)
4555    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4556  moreover {
4557    AOT_assume Necessary0(p)
4558    AOT_hence 1: p using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4559    AOT_have ¬((p)-)
4560      by (AOT_subst ¬((p)-) p)
4561         (auto simp add: 1 "thm-relation-negation:4")
4562    AOT_hence Impossible0(((p)-))
4563      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4564  }
4565  moreover {
4566    AOT_assume Impossible0(p)
4567    AOT_hence 1: ¬p
4568      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4569    AOT_have ((p)-)
4570      by (AOT_subst ((p)-) ¬p) 
4571         (auto simp: 1 "thm-relation-negation:3")
4572    AOT_hence Necessary0(((p)-))
4573      by (rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4574  }
4575  ultimately AOT_have Necessary0(((p)-))  Impossible0(((p)-))
4576    using "∨E"(1) "∨I" "→I" by metis
4577  AOT_thus NonContingent0(((p)-))
4578    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4579next
4580  AOT_assume NonContingent0(((p)-))
4581  AOT_hence Necessary0(((p)-))  Impossible0(((p)-))
4582    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4583  moreover {
4584    AOT_assume Impossible0(((p)-))
4585    AOT_hence 1: ¬((p)-)
4586      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4587    AOT_have p
4588      by (AOT_subst (reverse) p ¬((p)-))
4589         (auto simp: 1 "thm-relation-negation:4")
4590    AOT_hence Necessary0(p)
4591      using "contingent-properties:1[zero]"[THEN "≡dfI"] by blast
4592  }
4593  moreover {
4594    AOT_assume Necessary0(((p)-))
4595    AOT_hence 1: ((p)-)
4596      by (rule "contingent-properties:1[zero]"[THEN "≡dfE"])
4597    AOT_have ¬p
4598      by (AOT_subst (reverse) ¬p ((p)-))
4599         (auto simp: 1 "thm-relation-negation:3")
4600    AOT_hence Impossible0(p)
4601      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4602  }
4603  ultimately AOT_have Necessary0(p)  Impossible0(p)
4604    using "∨E"(1) "∨I" "→I" by metis
4605  AOT_thus NonContingent0(p)
4606    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4607qed
4608
4609AOT_theorem "thm-cont-propos:2": Contingent0(φ)  φ & ¬φ
4610proof -
4611  AOT_have Contingent0(φ)  ¬(Necessary0(φ)  Impossible0(φ))
4612    using "contingent-properties:4[zero]"[THEN "≡Df"] by simp
4613  also AOT_have   ¬Necessary0(φ) & ¬Impossible0(φ)
4614    by (fact AOT)
4615  also AOT_have   ¬Impossible0(φ) & ¬Necessary0(φ)
4616    by (fact AOT)
4617  also AOT_have   φ & ¬φ
4618    apply (AOT_subst φ ¬¬φ)
4619     apply (simp add: "conventions:5" "≡Df")
4620    apply (AOT_subst Impossible0(φ) ¬φ)
4621     apply (simp add: "contingent-properties:2[zero]" "≡Df")
4622    apply (AOT_subst (reverse) ¬φ ¬φ)
4623     apply (simp add: "KBasic:11")
4624    apply (AOT_subst Necessary0(φ) φ)
4625     apply (simp add: "contingent-properties:1[zero]" "≡Df")
4626    by (simp add: "oth-class-taut:3:a")
4627  finally show ?thesis.
4628qed
4629
4630AOT_theorem "thm-cont-propos:3": Contingent0(p)  Contingent0(((p)-))
4631proof -
4632  AOT_have Contingent0(p)  p & ¬p using "thm-cont-propos:2".
4633  also AOT_have   ¬p & p by (fact AOT)
4634  also AOT_have   ((p)-) & p
4635    by (AOT_subst ((p)-) ¬p)
4636       (auto simp: "thm-relation-negation:3" "oth-class-taut:3:a")
4637  also AOT_have   ((p)-) & ¬((p)-)
4638    by (AOT_subst ¬((p)-) p)
4639       (auto simp: "thm-relation-negation:4" "oth-class-taut:3:a")
4640  also AOT_have   Contingent0(((p)-))
4641    using "thm-cont-propos:2"[symmetric] by blast
4642  finally show ?thesis.
4643qed
4644
4645AOT_define noncontingent_prop :: ‹φ› ("p0")
4646  p0_def: "(p0) =df (x (E!x  E!x))"
4647
4648AOT_theorem "thm-noncont-propos:1":  Necessary0((p0))
4649proof(rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4650  AOT_show (p0)
4651    apply (rule "=dfI"(2)[OF p0_def])
4652    using "log-prop-prop:2" apply simp
4653    using "if-p-then-p" RN GEN by fast
4654qed
4655
4656AOT_theorem "thm-noncont-propos:2": Impossible0(((p0)-))
4657proof(rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4658  AOT_show ¬((p0)-)
4659    apply (AOT_subst ((p0)-) ¬p0)
4660    using "thm-relation-negation:3" GEN "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4661    apply (AOT_subst (reverse) ¬¬p0 p0)
4662     apply (simp add: "oth-class-taut:3:b")
4663    apply (rule "=dfI"(2)[OF p0_def])
4664    using "log-prop-prop:2" apply simp
4665    using "if-p-then-p" RN GEN by fast
4666qed
4667
4668AOT_theorem "thm-noncont-propos:3": NonContingent0((p0))
4669  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4670  using "thm-noncont-propos:1" "∨I" by blast
4671
4672AOT_theorem "thm-noncont-propos:4": NonContingent0(((p0)-))
4673  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4674  using "thm-noncont-propos:2" "∨I" by blast
4675
4676AOT_theorem "thm-noncont-propos:5": pq (NonContingent0((p)) & NonContingent0((q)) & p  q)
4677proof(rule "∃I")+
4678  AOT_have 0: φ  (φ)- for φ
4679    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4680  AOT_thus NonContingent0((p0)) & NonContingent0(((p0)-)) & (p0)  (p0)-
4681    using "thm-noncont-propos:3" "thm-noncont-propos:4" "&I" by auto
4682qed(auto simp: "log-prop-prop:2")
4683
4684AOT_act_theorem "no-cnac": ¬x(E!x & ¬𝒜E!x)
4685proof(rule "raa-cor:2")
4686  AOT_assume x(E!x & ¬𝒜E!x)
4687  then AOT_obtain a where a: E!a & ¬𝒜E!a
4688    using "∃E"[rotated] by blast
4689  AOT_hence 𝒜¬E!a using "&E" "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
4690  AOT_hence ¬E!a using "logic-actual"[act_axiom_inst, THEN "→E"] by blast
4691  AOT_hence E!a & ¬E!a using a "&E" "&I" by blast
4692  AOT_thus p & ¬p for p using "raa-cor:1" by blast
4693qed
4694
4695AOT_theorem "pos-not-pna:1": ¬𝒜x (E!x & ¬𝒜E!x)
4696proof(rule "raa-cor:2")
4697  AOT_assume 𝒜x (E!x & ¬𝒜E!x)
4698  AOT_hence x 𝒜(E!x & ¬𝒜E!x)
4699    using "Act-Basic:10"[THEN "≡E"(1)] by blast
4700  then AOT_obtain a where 𝒜(E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4701  AOT_hence 1: 𝒜E!a & 𝒜¬𝒜E!a using "Act-Basic:2"[THEN "≡E"(1)] by blast
4702  AOT_hence ¬𝒜𝒜E!a using "&E"(2) "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by blast
4703  AOT_hence ¬𝒜E!a using "logic-actual-nec:4"[axiom_inst, THEN "≡E"(1)] RAA by blast
4704  AOT_thus p & ¬p for p using 1[THEN "&E"(1)] "&I" "raa-cor:1" by blast
4705qed
4706
4707AOT_theorem "pos-not-pna:2": ¬x(E!x & ¬𝒜E!x)
4708proof (rule RAA(1))
4709  AOT_show ¬𝒜x (E!x & ¬𝒜E!x) using "pos-not-pna:1" by blast
4710next
4711  AOT_assume ¬¬x (E!x & ¬𝒜E!x)
4712  AOT_hence x (E!x & ¬𝒜E!x)
4713    using "KBasic:12"[THEN "≡E"(2)] by blast
4714  AOT_thus 𝒜x (E!x & ¬𝒜E!x)
4715    using "nec-imp-act"[THEN "→E"] by blast
4716qed
4717
4718AOT_theorem "pos-not-pna:3": x (E!x & ¬𝒜E!x)
4719proof -
4720  AOT_obtain a where (E!a & ¬𝒜E!a)
4721    using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] "∃E"[rotated] by blast
4722  AOT_hence θ: E!a and ξ: ¬𝒜E!a using "KBasic2:3"[THEN "→E"] "&E" by blast+
4723  AOT_have ¬𝒜E!a using ξ "KBasic:11"[THEN "≡E"(2)] by blast
4724  AOT_hence ¬𝒜E!a using "Act-Basic:6"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)] by blast
4725  AOT_hence E!a & ¬𝒜E!a using θ "&I" by blast
4726  thus ?thesis using "∃I" by fast
4727qed
4728
4729AOT_define contingent_prop :: φ ("q0")
4730  q0_def: (q0) =df (x (E!x & ¬𝒜E!x))
4731
4732AOT_theorem q0_prop: q0 & ¬q0
4733  apply (rule "=dfI"(2)[OF q0_def])
4734  apply (fact "log-prop-prop:2")
4735  apply (rule "&I")
4736   apply (fact "qml:4"[axiom_inst])
4737  by (fact "pos-not-pna:2")
4738
4739AOT_theorem "basic-prop:1": Contingent0((q0))
4740proof(rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4741  AOT_have ¬Necessary0((q0)) & ¬Impossible0((q0))
4742  proof (rule "&I"; rule "=dfI"(2)[OF q0_def]; (rule "log-prop-prop:2" | rule "raa-cor:2"))
4743    AOT_assume Necessary0(x (E!x & ¬𝒜E!x))
4744    AOT_hence x (E!x & ¬𝒜E!x)
4745      using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4746    AOT_hence 𝒜x (E!x & ¬𝒜E!x)
4747      using "Act-Basic:8"[THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
4748    AOT_thus 𝒜x (E!x & ¬𝒜E!x) & ¬𝒜x (E!x & ¬𝒜E!x)
4749      using "pos-not-pna:1" "&I" by blast
4750  next
4751    AOT_assume Impossible0(x (E!x & ¬𝒜E!x))
4752    AOT_hence ¬(x (E!x & ¬𝒜E!x))
4753      using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4754    AOT_hence ¬(x (E!x & ¬𝒜E!x)) using "KBasic2:1"[THEN "≡E"(1)] by blast
4755    AOT_thus (x (E!x & ¬𝒜E!x)) & ¬(x (E!x & ¬𝒜E!x))
4756      using "qml:4"[axiom_inst] "&I" by blast
4757  qed
4758  AOT_thus ¬(Necessary0((q0))  Impossible0((q0)))
4759    using "oth-class-taut:5:d" "≡E"(2) by blast
4760qed
4761
4762AOT_theorem "basic-prop:2": p Contingent0((p))
4763  using "∃I"(1)[rotated, OF "log-prop-prop:2"] "basic-prop:1" by blast
4764
4765AOT_theorem "basic-prop:3": Contingent0(((q0)-))
4766  apply (AOT_subst ((q0)-) ¬q0)
4767   apply (insert "thm-relation-negation:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"]; fast)
4768  apply (rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4769  apply (rule "oth-class-taut:5:d"[THEN "≡E"(2)])
4770  apply (rule "&I")
4771   apply (rule "contingent-properties:1[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4772   apply (rule "conventions:5"[THEN "≡dfE"])
4773   apply (rule "=dfE"(2)[OF q0_def])
4774    apply (rule "log-prop-prop:2")
4775   apply (rule q0_prop[THEN "&E"(1)])
4776  apply (rule "contingent-properties:2[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4777  apply (rule "conventions:5"[THEN "≡dfE"])
4778  by (rule q0_prop[THEN "&E"(2)])
4779
4780AOT_theorem "basic-prop:4": pq (p  q & Contingent0(p) & Contingent0(q))
4781proof(rule "∃I")+
4782  AOT_have 0: φ  (φ)- for φ
4783    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4784  AOT_show (q0)  (q0)- & Contingent0(q0) & Contingent0(((q0)-))
4785    using "basic-prop:1" "basic-prop:3" "&I" 0 by presburger
4786qed(auto simp: "log-prop-prop:2")
4787
4788AOT_theorem "proposition-facts:1": NonContingent0(p)  ¬q (Contingent0(q) & q = p)
4789proof(rule "→I"; rule "raa-cor:2")
4790  AOT_assume NonContingent0(p)
4791  AOT_hence 1: Necessary0(p)  Impossible0(p)
4792    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4793  AOT_assume q (Contingent0(q) & q = p)
4794  then AOT_obtain q where Contingent0(q) & q = p using "∃E"[rotated] by blast
4795  AOT_hence Contingent0(p) using "rule=E" "&E" by fast
4796  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4797    using "contingent-properties:4[zero]"[THEN "≡dfE"] 1 "&I" by blast
4798qed
4799
4800AOT_theorem "proposition-facts:2": Contingent0(p)  ¬q (NonContingent0(q) & q = p)
4801proof(rule "→I"; rule "raa-cor:2")
4802  AOT_assume Contingent0(p)
4803  AOT_hence 1: ¬(Necessary0(p)  Impossible0(p))
4804    using "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4805  AOT_assume q (NonContingent0(q) & q = p)
4806  then AOT_obtain q where NonContingent0(q) & q = p using "∃E"[rotated] by blast
4807  AOT_hence NonContingent0(p) using "rule=E" "&E" by fast
4808  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4809    using "contingent-properties:3[zero]"[THEN "≡dfE"] 1 "&I" by blast
4810qed
4811
4812AOT_theorem "proposition-facts:3": (p0)  (p0)- & (p0)  (q0) & (p0)  (q0)- & (p0)-  (q0)- & (q0)  (q0)-
4813proof -
4814  {
4815    fix χ φ ψ
4816    AOT_assume χ{φ}
4817    moreover AOT_assume ¬χ{ψ}
4818    ultimately AOT_have ¬(χ{φ}  χ{ψ})
4819      using RAA "≡E" by metis
4820    moreover {
4821      AOT_have pq ((¬(χ{p}  χ{q}))  p  q)
4822        by (rule "∀I"; rule "∀I"; rule "pos-not-equiv-ne:4[zero]")
4823      AOT_hence ((¬(χ{φ}  χ{ψ}))  φ  ψ)
4824        using "∀E" "log-prop-prop:2" by blast
4825    }
4826    ultimately AOT_have φ  ψ
4827      using "→E" by blast
4828  } note 0 = this
4829  AOT_have contingent_neg: Contingent0(φ)  Contingent0(((φ)-)) for φ
4830    using "thm-cont-propos:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4831  AOT_have not_noncontingent_if_contingent: ¬NonContingent0(φ) if Contingent0(φ) for φ
4832    apply (rule "contingent-properties:3[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4833    using that "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4834  show ?thesis
4835    apply (rule "&I")+
4836    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4837       apply (rule 0)
4838    using "thm-noncont-propos:3" apply fast
4839       apply (rule not_noncontingent_if_contingent)
4840       apply (fact AOT)
4841      apply (rule 0)
4842    apply (rule "thm-noncont-propos:3")
4843      apply (rule not_noncontingent_if_contingent)
4844      apply (rule contingent_neg[THEN "≡E"(1)])
4845      apply (fact AOT)
4846     apply (rule 0)
4847    apply (rule "thm-noncont-propos:4")
4848      apply (rule not_noncontingent_if_contingent)
4849      apply (rule contingent_neg[THEN "≡E"(1)])
4850     apply (fact AOT)
4851    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4852qed
4853
4854AOT_define ContingentlyTrue :: ‹φ  φ› ("ContingentlyTrue'(_')")
4855  "cont-tf:1": ContingentlyTrue(p) df p & ¬p
4856
4857AOT_define ContingentlyFalse :: ‹φ  φ› ("ContingentlyFalse'(_')")
4858  "cont-tf:2": ContingentlyFalse(p) df ¬p & p
4859
4860AOT_theorem "cont-true-cont:1": ContingentlyTrue((p))  Contingent0((p))
4861proof(rule "→I")
4862  AOT_assume ContingentlyTrue((p))
4863  AOT_hence 1: p and 2: ¬p using "cont-tf:1"[THEN "≡dfE"] "&E" by blast+
4864  AOT_have ¬Necessary0((p))
4865    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4866    using 2 "KBasic:11"[THEN "≡E"(2)] by blast
4867  moreover AOT_have ¬Impossible0((p))
4868    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4869    apply (rule "conventions:5"[THEN "≡dfE"])
4870    using "T◇"[THEN "→E", OF 1].
4871  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4872    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4873  AOT_thus Contingent0((p))
4874    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4875qed
4876
4877AOT_theorem "cont-true-cont:2": ContingentlyFalse((p))  Contingent0((p))
4878proof(rule "→I")
4879  AOT_assume ContingentlyFalse((p))
4880  AOT_hence 1: ¬p and 2: p using "cont-tf:2"[THEN "≡dfE"] "&E" by blast+
4881  AOT_have ¬Necessary0((p))
4882    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4883    using "KBasic:11"[THEN "≡E"(2)] "T◇"[THEN "→E", OF 1] by blast
4884  moreover AOT_have ¬Impossible0((p))
4885    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4886    apply (rule "conventions:5"[THEN "≡dfE"])
4887    using 2.
4888  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4889    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4890  AOT_thus Contingent0((p))
4891    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4892qed
4893
4894AOT_theorem "cont-true-cont:3": ContingentlyTrue((p))  ContingentlyFalse(((p)-))
4895proof(rule "≡I"; rule "→I")
4896  AOT_assume ContingentlyTrue((p))
4897  AOT_hence 0: p & ¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4898  AOT_have 1: ContingentlyFalse(¬p)
4899    apply (rule "cont-tf:2"[THEN "≡dfI"])
4900    apply (AOT_subst (reverse) ¬¬p p)
4901    by (auto simp: "oth-class-taut:3:b" 0)
4902  AOT_show ContingentlyFalse(((p)-))
4903    apply (AOT_subst ((p)-) ¬p)
4904    by (auto simp: "thm-relation-negation:3" 1)
4905next
4906  AOT_assume 1: ContingentlyFalse(((p)-))
4907  AOT_have ContingentlyFalse(¬p)
4908    by (AOT_subst (reverse) ¬p ((p)-))
4909       (auto simp: "thm-relation-negation:3" 1)
4910  AOT_hence ¬¬p & ¬p using "cont-tf:2"[THEN "≡dfE"] by blast
4911  AOT_hence p & ¬p
4912    using "&I" "&E" "useful-tautologies:1"[THEN "→E"] by metis
4913  AOT_thus ContingentlyTrue((p))
4914    using "cont-tf:1"[THEN "≡dfI"] by blast
4915qed
4916
4917AOT_theorem "cont-true-cont:4": ContingentlyFalse((p))  ContingentlyTrue(((p)-))
4918proof(rule "≡I"; rule "→I")
4919  AOT_assume ContingentlyFalse(p)
4920  AOT_hence 0: ¬p & p
4921    using "cont-tf:2"[THEN "≡dfE"] by blast
4922  AOT_have ¬p & ¬¬p
4923    by (AOT_subst (reverse) ¬¬p p)
4924       (auto simp: "oth-class-taut:3:b" 0)
4925  AOT_hence 1: ContingentlyTrue(¬p)
4926    by (rule "cont-tf:1"[THEN "≡dfI"])
4927  AOT_show ContingentlyTrue(((p)-))
4928    by (AOT_subst ((p)-) ¬p)
4929       (auto simp: "thm-relation-negation:3" 1)
4930next
4931  AOT_assume 1: ContingentlyTrue(((p)-))
4932  AOT_have ContingentlyTrue(¬p)
4933    by (AOT_subst (reverse) ¬p ((p)-))
4934       (auto simp add: "thm-relation-negation:3" 1)
4935  AOT_hence 2: ¬p & ¬¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4936  AOT_have p
4937    by (AOT_subst p ¬¬p)
4938       (auto simp add: "oth-class-taut:3:b" 2[THEN "&E"(2)])
4939  AOT_hence ¬p & p using 2[THEN "&E"(1)] "&I" by blast
4940  AOT_thus ContingentlyFalse(p)
4941    by (rule "cont-tf:2"[THEN "≡dfI"])
4942qed
4943
4944AOT_theorem "cont-true-cont:5": (ContingentlyTrue((p)) & Necessary0((q)))  p  q
4945proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4946  AOT_assume ContingentlyTrue((p))
4947  AOT_hence ¬p
4948    using "cont-tf:1"[THEN "≡dfE"] "&E" by blast
4949  AOT_hence 0: ¬p using "KBasic:11"[THEN "≡E"(2)] by blast
4950  AOT_assume Necessary0((q))
4951  moreover AOT_assume ¬(p  q)
4952  AOT_hence p = q
4953    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4954          "useful-tautologies:1"[THEN "→E"] by blast
4955  ultimately AOT_have Necessary0((p)) using "rule=E" id_sym by blast
4956  AOT_hence p
4957    using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4958  AOT_thus p & ¬p using 0 "&I" by blast
4959qed
4960
4961AOT_theorem "cont-true-cont:6": (ContingentlyFalse((p)) & Impossible0((q)))  p  q
4962proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4963  AOT_assume ContingentlyFalse((p))
4964  AOT_hence p
4965    using "cont-tf:2"[THEN "≡dfE"] "&E" by blast
4966  AOT_hence 1: ¬¬p
4967    using "conventions:5"[THEN "≡dfE"] by blast
4968  AOT_assume Impossible0((q))
4969  moreover AOT_assume ¬(p  q)
4970  AOT_hence p = q
4971    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4972          "useful-tautologies:1"[THEN "→E"] by blast
4973  ultimately AOT_have Impossible0((p)) using "rule=E" id_sym by blast
4974  AOT_hence ¬p
4975    using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4976  AOT_thus ¬p & ¬¬p using 1 "&I" by blast
4977qed
4978
4979AOT_act_theorem "q0cf:1": ContingentlyFalse(q0)
4980  apply (rule "cont-tf:2"[THEN "≡dfI"])
4981  apply (rule "=dfI"(2)[OF q0_def])
4982   apply (fact "log-prop-prop:2")
4983  apply (rule "&I")
4984   apply (fact "no-cnac")
4985  by (fact "qml:4"[axiom_inst])
4986
4987AOT_act_theorem "q0cf:2": ContingentlyTrue(((q0)-))
4988  apply (rule "cont-tf:1"[THEN "≡dfI"])
4989  apply (rule "=dfI"(2)[OF q0_def])
4990   apply (fact "log-prop-prop:2")
4991  apply (rule "&I")
4992     apply (rule "thm-relation-negation:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(2)])
4993     apply (fact "no-cnac")
4994    apply (rule "rule=E"[rotated, OF "thm-relation-negation:7"[unvarify p, OF "log-prop-prop:2", THEN id_sym]])
4995  apply (AOT_subst (reverse) ¬¬(x  (E!x & ¬𝒜E!x)) x (E!x & ¬𝒜E!x))
4996  by (auto simp: "oth-class-taut:3:b" "qml:4"[axiom_inst])
4997
4998(* TODO: q0cf-rem skipped for now *)
4999
5000AOT_theorem "cont-tf-thm:1": p ContingentlyTrue((p))
5001proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
5002  AOT_assume q0
5003  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
5004  AOT_thus ContingentlyTrue(q0)
5005    by (rule "cont-tf:1"[THEN "≡dfI"])
5006next
5007  AOT_assume ¬q0
5008  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
5009  AOT_hence ContingentlyFalse(q0)
5010    by (rule "cont-tf:2"[THEN "≡dfI"])
5011  AOT_thus ContingentlyTrue(((q0)-))
5012    by (rule "cont-true-cont:4"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
5013qed(auto simp: "log-prop-prop:2")
5014
5015
5016AOT_theorem "cont-tf-thm:2": p ContingentlyFalse((p))
5017proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
5018  AOT_assume q0
5019  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
5020  AOT_hence ContingentlyTrue(q0)
5021    by (rule "cont-tf:1"[THEN "≡dfI"])
5022  AOT_thus ContingentlyFalse(((q0)-))
5023    by (rule "cont-true-cont:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
5024next
5025  AOT_assume ¬q0
5026  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
5027  AOT_thus ContingentlyFalse(q0)
5028    by (rule "cont-tf:2"[THEN "≡dfI"])
5029qed(auto simp: "log-prop-prop:2")
5030
5031(* TODO: inspect modally strict subproof involving obtained variable *)
5032AOT_theorem "property-facts1:1": Fx ([F]x & ¬[F]x)
5033proof -
5034  fix x
5035  AOT_obtain p1 where ContingentlyTrue((p1))
5036    using "cont-tf-thm:1" "∃E"[rotated] by blast
5037  AOT_hence 1: p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
5038  AOT_modally_strict {
5039    AOT_have for arbitrary p:  (z p]x  p)
5040      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5041    AOT_hence for arbitrary p:   (z p]x  p)
5042      by (rule RN)
5043    AOT_hence p (z p]x  p) using GEN by fast
5044    AOT_hence (z p1]x  p1) using "∀E" by fast
5045  } note 2 = this
5046  AOT_hence (z p1]x  p1) using "∀E" by blast
5047  AOT_hence z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
5048  moreover AOT_have ¬z p1]x
5049    apply (AOT_subst_using subst: 2[THEN "qml:2"[axiom_inst, THEN "→E"]])
5050    using 1[THEN "&E"(2)] by blast
5051  ultimately AOT_have z p1]x & ¬z p1]x using "&I" by blast
5052  AOT_hence x (z p1]x & ¬z p1]x) using "∃I"(2) by fast
5053  moreover AOT_have z p1] by "cqt:2[lambda]"
5054  ultimately AOT_show Fx ([F]x & ¬[F]x) by (rule "∃I"(1))
5055qed
5056
5057(* TODO: inspect modally strict subproof involving obtained variable *)
5058AOT_theorem "property-facts1:2": Fx (¬[F]x & [F]x)
5059proof -
5060  fix x
5061  AOT_obtain p1 where ContingentlyFalse((p1))
5062    using "cont-tf-thm:2" "∃E"[rotated] by blast
5063  AOT_hence 1: ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
5064  AOT_modally_strict {
5065    AOT_have for arbitrary p:  (z p]x  p)
5066      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5067    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
5068      using "oth-class-taut:4:b" "≡E" by blast
5069    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
5070      by (rule RN)
5071    AOT_hence p (¬z p]x  ¬p) using GEN by fast
5072    AOT_hence (¬z p1]x  ¬p1) using "∀E" by fast
5073  } note 2 = this
5074  AOT_hence (¬z p1]x  ¬p1) using "∀E" by blast
5075  AOT_hence 3: ¬z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
5076  AOT_modally_strict {
5077    AOT_have for arbitrary p:  (z p]x  p)
5078      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5079    AOT_hence for arbitrary p:  (z p]x  p)
5080      by (rule RN)
5081    AOT_hence p (z p]x  p) using GEN by fast
5082    AOT_hence (z p1]x  p1) using "∀E" by fast
5083  } note 4 = this
5084  AOT_have z p1]x
5085    apply (AOT_subst_using subst: 4[THEN "qml:2"[axiom_inst, THEN "→E"]])
5086    using 1[THEN "&E"(2)] by blast
5087  AOT_hence ¬z p1]x & z p1]x using 3 "&I" by blast
5088  AOT_hence x (¬z p1]x & z p1]x) using "∃I"(2) by fast
5089  moreover AOT_have z p1] by "cqt:2[lambda]"
5090  ultimately AOT_show Fx (¬[F]x & [F]x) by (rule "∃I"(1))
5091qed
5092
5093context
5094begin
5095
5096private AOT_lemma eqnotnec_123_Aux_ζ: [L]x  (E!x  E!x)
5097    apply (rule "=dfI"(2)[OF L_def])
5098     apply "cqt:2[lambda]"
5099    apply (rule "beta-C-meta"[THEN "→E"])
5100  by "cqt:2[lambda]"
5101
5102private AOT_lemma eqnotnec_123_Aux_ω: z φ]x  φ
5103    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5104
5105private AOT_lemma eqnotnec_123_Aux_θ: φ  x([L]x  z φ]x)
5106proof(rule "≡I"; rule "→I"; (rule "∀I")?)
5107  fix x
5108  AOT_assume 1: φ
5109  AOT_have [L]x  (E!x  E!x) using eqnotnec_123_Aux_ζ.
5110  also AOT_have   φ
5111    using "if-p-then-p" 1 "≡I" "→I" by simp
5112  also AOT_have   z φ]x
5113    using "Commutativity of ≡"[THEN "≡E"(1)] eqnotnec_123_Aux_ω by blast
5114  finally AOT_show [L]x  z φ]x.
5115next
5116  fix x
5117  AOT_assume x([L]x  z φ]x)
5118  AOT_hence [L]x  z φ]x using "∀E" by blast
5119  also AOT_have   φ using eqnotnec_123_Aux_ω.
5120  finally AOT_have φ  [L]x using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5121  also AOT_have   E!x  E!x using eqnotnec_123_Aux_ζ.
5122  finally AOT_show φ using "≡E" "if-p-then-p" by fast
5123qed
5124private lemmas eqnotnec_123_Aux_ξ =  eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5125                      THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5126                      THEN "RM◇"]
5127private lemmas eqnotnec_123_Aux_ξ' = eqnotnec_123_Aux_θ[THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)], THEN "RM◇"]
5128
5129AOT_theorem "eqnotnec:1": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5130proof-
5131  AOT_obtain p1 where ContingentlyTrue(p1) using "cont-tf-thm:1" "∃E"[rotated] by blast
5132  AOT_hence p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
5133  AOT_hence x ([L]x  z p1]x) & ¬x([L]x  z p1]x)
5134    apply - apply (rule "&I")
5135    using "&E" eqnotnec_123_Aux_θ[THEN "≡E"(1)] eqnotnec_123_Aux_ξ "→E" by fast+
5136  AOT_hence G (x([L]x  [G]x) & ¬x([L]x  [G]x))
5137    by (rule "∃I") "cqt:2[lambda]"
5138  AOT_thus FG (x([F]x  [G]x) & ¬x([F]x  [G]x))
5139    apply (rule "∃I")
5140    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5141qed
5142
5143AOT_theorem "eqnotnec:2": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5144proof-
5145  AOT_obtain p1 where ContingentlyFalse(p1) using "cont-tf-thm:2" "∃E"[rotated] by blast
5146  AOT_hence ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
5147  AOT_hence ¬x ([L]x  z p1]x) & x([L]x  z p1]x)
5148    apply - apply (rule "&I")
5149    using "&E" eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)] eqnotnec_123_Aux_ξ' "→E" by fast+
5150  AOT_hence G (¬x([L]x  [G]x) & x([L]x  [G]x))
5151    by (rule "∃I") "cqt:2[lambda]"
5152  AOT_thus FG (¬x([F]x  [G]x) & x([F]x  [G]x))
5153    apply (rule "∃I")
5154    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5155qed
5156
5157AOT_theorem "eqnotnec:3": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5158proof-
5159  AOT_have ¬𝒜q0
5160    apply (rule "=dfI"(2)[OF q0_def])
5161     apply (fact "log-prop-prop:2")
5162    by (fact AOT)
5163  AOT_hence 𝒜¬q0
5164    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5165  AOT_hence 𝒜¬x ([L]x  z q0]x)
5166    using eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5167            THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5168            THEN "RA[2]", THEN "act-cond"[THEN "→E"], THEN "→E"] by blast
5169  moreover AOT_have x ([L]x  z q0]x) using eqnotnec_123_Aux_ξ'[THEN "→E"] q0_prop[THEN "&E"(1)] by blast
5170  ultimately AOT_have 𝒜¬x ([L]x  z q0]x) & x ([L]x  z q0]x) using "&I" by blast
5171  AOT_hence G (𝒜¬x([L]x  [G]x) & x([L]x  [G]x))
5172    by (rule "∃I") "cqt:2[lambda]"
5173  AOT_thus FG (𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5174    apply (rule "∃I")
5175    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5176qed
5177
5178end
5179
5180(* TODO[IMPORTANT]: proof of 219.4 ζ: appeal to (159.2) requires a theorem, but the result has local
5181   assumptions! *)
5182AOT_theorem "eqnotnec:4": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5183proof(rule GEN)
5184  fix F
5185
5186  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5187  proof(rule "→I"; rule GEN)
5188    AOT_modally_strict {
5189    fix x
5190    AOT_assume 0: ψ
5191    AOT_have z [F]z & ψ]x  [F]x & ψ
5192      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5193    also AOT_have ...  [F]x
5194      apply (rule "≡I"; rule "→I")
5195      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5196      using 0 "&I" by blast
5197    finally AOT_show [F]x  z [F]z & ψ]x
5198      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5199    }
5200  qed
5201
5202  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5203  proof (rule "→I"; rule GEN)
5204    AOT_modally_strict {
5205      fix x
5206      AOT_assume 0: ψ
5207      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5208        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5209      also AOT_have ...  [F]x
5210        apply (rule "≡I"; rule "→I")
5211        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5212        apply (rule "∨I"(1)) using 0 "&I" by blast
5213      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5214        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5215    }
5216  qed
5217
5218  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5219  proof(rule "RM◇"; rule "→I"; rule "raa-cor:2")
5220  AOT_modally_strict {
5221      AOT_assume 0: ¬ψ
5222      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5223      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5224      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5225          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5226      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5227        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5228      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5229        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5230      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5231      ultimately AOT_have ψ using "≡E" "&E" by metis
5232      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5233    }
5234  qed
5235
5236  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5237  proof (rule "→I")
5238    AOT_assume A: z([F]z  z [F]z & ψ]z)
5239    AOT_show ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5240    proof(rule "≡I"; rule "KBasic:13"[THEN "→E"];
5241          rule "RN[prem]"[where Γ="{«z([F]z  z [F]z & ψ]z)»}", simplified];
5242          (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5243      AOT_modally_strict {
5244        AOT_assume z ([F]z  z [F]z & ψ]z)
5245        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5246        AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5247        AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5248        AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5249        AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5250      }
5251    next
5252      AOT_modally_strict {
5253        AOT_assume z ([F]z  z [F]z & ψ]z)
5254        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5255        AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5256        AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5257        AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5258        AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5259      }
5260    qed(auto simp: A)
5261  qed
5262
5263  AOT_obtain p1 where p1_prop: p1 & ¬p1 using "cont-tf-thm:1" "∃E"[rotated] "cont-tf:1"[THEN "≡dfE"] by blast
5264  {
5265    AOT_assume 1: x([F]x  z [F]z & p1]x)
5266    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5267      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5268    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5269      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5270    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5271      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5272    AOT_hence x([F]x  z [F]z & p1  ¬p1]x) & ¬x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5273    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5274      by (rule "∃I"(1)) "cqt:2[lambda]"
5275  }
5276  moreover {
5277    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5278    AOT_hence ¬x([F]x  z [F]z & p1]x)
5279      using "KBasic:11"[THEN "≡E"(1)] by blast
5280    AOT_hence x ([F]x  z [F]z & p1]x) & ¬x([F]x  z [F]z & p1]x)
5281      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(1)]] "&I" by blast
5282    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5283      by (rule "∃I"(1)) "cqt:2[lambda]"
5284  }
5285  ultimately AOT_show G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5286    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5287qed
5288
5289AOT_theorem "eqnotnec:5": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5290proof(rule GEN)
5291  fix F
5292
5293  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5294  proof(rule "RM◇"; rule "→I"; rule GEN)
5295    AOT_modally_strict {
5296    fix x
5297    AOT_assume 0: ψ
5298    AOT_have z [F]z & ψ]x  [F]x & ψ
5299      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5300    also AOT_have ...  [F]x
5301      apply (rule "≡I"; rule "→I")
5302      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5303      using 0 "&I" by blast
5304    finally AOT_show [F]x  z [F]z & ψ]x
5305      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5306    }
5307  qed
5308
5309  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5310  proof (rule "RM◇"; rule "→I"; rule GEN)
5311    AOT_modally_strict {
5312      fix x
5313      AOT_assume 0: ψ
5314      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5315        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5316      also AOT_have ...  [F]x
5317        apply (rule "≡I"; rule "→I")
5318        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5319        apply (rule "∨I"(1)) using 0 "&I" by blast
5320      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5321        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5322    }
5323  qed
5324
5325  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5326  proof(rule "→I"; rule "raa-cor:2")
5327  AOT_modally_strict {
5328      AOT_assume 0: ¬ψ
5329      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5330      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5331      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5332          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5333      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5334        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5335      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5336        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5337      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5338      ultimately AOT_have ψ using "≡E" "&E" by metis
5339      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5340    }
5341  qed
5342
5343  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5344  proof (rule "→I"; rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5345    AOT_modally_strict {
5346      AOT_assume z ([F]z  z [F]z & ψ]z)
5347      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5348      AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5349      AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5350      AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5351      AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5352    }
5353  next
5354    AOT_modally_strict {
5355      AOT_assume z ([F]z  z [F]z & ψ]z)
5356      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5357      AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5358      AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5359      AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5360      AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5361    }
5362  qed
5363
5364  AOT_obtain p1 where p1_prop: ¬p1 & p1 using "cont-tf-thm:2" "∃E"[rotated] "cont-tf:2"[THEN "≡dfE"] by blast
5365  {
5366    AOT_assume 1: x([F]x  z [F]z & p1]x)
5367    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5368      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5369    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5370      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5371    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5372      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5373    AOT_hence ¬x([F]x  z [F]z & p1  ¬p1]x) & x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5374    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5375      by (rule "∃I"(1)) "cqt:2[lambda]"
5376  }
5377  moreover {
5378    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5379    AOT_hence ¬x([F]x  z [F]z & p1]x)
5380      using "KBasic:11"[THEN "≡E"(1)] by blast
5381    AOT_hence ¬x ([F]x  z [F]z & p1]x) & x([F]x  z [F]z & p1]x)
5382      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(2)]] "&I" by blast
5383    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5384      by (rule "∃I"(1)) "cqt:2[lambda]"
5385  }
5386  ultimately AOT_show G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5387    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5388qed
5389
5390AOT_theorem "eqnotnec:6": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5391proof(rule GEN)
5392  fix F
5393
5394  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5395  proof(rule "RM◇"; rule "→I"; rule GEN)
5396    AOT_modally_strict {
5397    fix x
5398    AOT_assume 0: ψ
5399    AOT_have z [F]z & ψ]x  [F]x & ψ
5400      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5401    also AOT_have ...  [F]x
5402      apply (rule "≡I"; rule "→I")
5403      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5404      using 0 "&I" by blast
5405    finally AOT_show [F]x  z [F]z & ψ]x
5406      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5407    }
5408  qed
5409
5410  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5411  proof (rule "RM◇"; rule "→I"; rule GEN)
5412    AOT_modally_strict {
5413      fix x
5414      AOT_assume 0: ψ
5415      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5416        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5417      also AOT_have ...  [F]x
5418        apply (rule "≡I"; rule "→I")
5419        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5420        apply (rule "∨I"(1)) using 0 "&I" by blast
5421      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5422        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5423    }
5424  qed
5425
5426  AOT_have Aux_C:  𝒜¬ψ  𝒜¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5427  proof(rule "act-cond"[THEN "→E"]; rule "RA[2]"; rule "→I"; rule "raa-cor:2")
5428  AOT_modally_strict {
5429      AOT_assume 0: ¬ψ
5430      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5431      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5432      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5433          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5434      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5435        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5436      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5437        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5438      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5439      ultimately AOT_have ψ using "≡E" "&E" by metis
5440      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5441    }
5442  qed
5443
5444  AOT_have Aux_D: 𝒜z ([F]z  z [F]z & ψ]z)  (𝒜¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  𝒜¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5445  proof (rule "→I"; rule "Act-Basic:5"[THEN "≡E"(1)])
5446    AOT_assume 𝒜z ([F]z  z [F]z & ψ]z)
5447    AOT_thus 𝒜(¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x))
5448    proof (rule "RA[3]"[where Γ="{«z ([F]z  z [F]z & ψ]z)»}", simplified, rotated])
5449      AOT_modally_strict {
5450        AOT_assume z ([F]z  z [F]z & ψ]z)
5451        AOT_thus ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5452          apply -
5453        proof(rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5454        AOT_modally_strict {
5455          AOT_assume z ([F]z  z [F]z & ψ]z)
5456          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5457          AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5458          AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5459          AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5460          AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5461        }
5462      next
5463        AOT_modally_strict {
5464          AOT_assume z ([F]z  z [F]z & ψ]z)
5465          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5466          AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5467          AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5468          AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5469          AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5470        }
5471      qed
5472      }
5473    qed
5474  qed
5475
5476  AOT_have ¬𝒜q0
5477    apply (rule "=dfI"(2)[OF q0_def])
5478     apply (fact "log-prop-prop:2")
5479    by (fact AOT)
5480  AOT_hence q0_prop_1: 𝒜¬q0
5481    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5482  {
5483    AOT_assume 1: 𝒜x([F]x  z [F]z & q0]x)
5484    AOT_have 2: x([F]x  z [F]z & q0  ¬q0]x)
5485      using Aux_B[THEN "→E", OF q0_prop[THEN "&E"(1)]].
5486    AOT_have 𝒜¬x(z [F]z & q0]x  z [F]z & q0  ¬q0]x)
5487      using Aux_C[THEN "→E", OF q0_prop_1].
5488    AOT_hence 3: 𝒜¬x([F]x  z [F]z & q0  ¬q0]x)
5489      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5490    AOT_hence 𝒜¬x([F]x  z [F]z & q0  ¬q0]x) & x([F]x  z [F]z & q0  ¬q0]x) using 2 "&I" by blast
5491    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5492      by (rule "∃I"(1)) "cqt:2[lambda]"
5493  }
5494  moreover {
5495    AOT_assume 2: ¬𝒜x([F]x  z [F]z & q0]x)
5496    AOT_hence 𝒜¬x([F]x  z [F]z & q0]x)
5497      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5498    AOT_hence 𝒜¬x ([F]x  z [F]z & q0]x) & x([F]x  z [F]z & q0]x)
5499      using Aux_A[THEN "→E", OF q0_prop[THEN "&E"(1)]] "&I" by blast
5500    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5501      by (rule "∃I"(1)) "cqt:2[lambda]"
5502  }
5503  ultimately AOT_show G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5504    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5505qed
5506
5507AOT_theorem "oa-contingent:1": O!  A!
5508proof(rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
5509  fix x
5510  AOT_assume 1: O! = A!
5511  AOT_hence x E!x] = A!
5512    by (rule "=dfE"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5513  AOT_hence x E!x] = x ¬E!x]
5514    by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5515  moreover AOT_have x E!x]x  E!x
5516    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5517  ultimately AOT_have x ¬E!x]x  E!x
5518    using "rule=E" by fast
5519  moreover AOT_have x ¬E!x]x  ¬E!x
5520    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5521  ultimately AOT_have E!x  ¬E!x using "≡E"(6) "Commutativity of ≡"[THEN "≡E"(1)] by blast
5522  AOT_thus "(E!x  ¬E!x) & ¬(E!x  ¬E!x)" using "oth-class-taut:3:c" "&I" by blast
5523qed
5524
5525AOT_theorem "oa-contingent:2": O!x  ¬A!x
5526proof -
5527  AOT_have O!x  x E!x]x
5528    apply (rule "≡I"; rule "→I")
5529     apply (rule "=dfE"(2)[OF AOT_ordinary])
5530      apply "cqt:2[lambda]"
5531     apply argo
5532    apply (rule  "=dfI"(2)[OF AOT_ordinary])
5533     apply "cqt:2[lambda]"
5534    by argo
5535  also AOT_have   E!x
5536    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5537  also AOT_have   ¬¬E!x
5538    using "oth-class-taut:3:b".
5539  also AOT_have   ¬x ¬E!x]x
5540    by (rule "beta-C-meta"[THEN "→E", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric]) "cqt:2[lambda]"
5541  also AOT_have   ¬A!x
5542    apply (rule "≡I"; rule "→I")
5543     apply (rule "=dfI"(2)[OF AOT_abstract])
5544      apply "cqt:2[lambda]"
5545     apply argo
5546    apply (rule "=dfE"(2)[OF AOT_abstract])
5547     apply "cqt:2[lambda]"
5548    by argo
5549  finally show ?thesis.
5550qed
5551
5552AOT_theorem "oa-contingent:3": A!x  ¬O!x
5553  by (AOT_subst A!x ¬¬A!x)
5554     (auto simp add: "oth-class-taut:3:b" "oa-contingent:2"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric])
5555
5556AOT_theorem "oa-contingent:4": Contingent(O!)
5557proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:1", THEN "≡E"(2)]; rule "&I")
5558  AOT_have x E!x using "thm-cont-e:3" .
5559  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5560  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5561  AOT_hence x E!x]a
5562    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5563  AOT_hence O!a
5564    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5565  AOT_hence x O!x using "∃I" by blast
5566  AOT_thus x O!x using "T◇"[THEN "→E"] by blast
5567next
5568  AOT_obtain a where A!a
5569    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5570  AOT_hence ¬O!a using "oa-contingent:3"[THEN "≡E"(1)] by blast
5571  AOT_hence x ¬O!x using "∃I" by fast
5572  AOT_thus x ¬O!x using "T◇"[THEN "→E"] by blast
5573qed
5574
5575AOT_theorem "oa-contingent:5": Contingent(A!)
5576proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:2", THEN "≡E"(2)]; rule "&I")
5577  AOT_obtain a where A!a
5578    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5579  AOT_hence x A!x using "∃I" by fast
5580  AOT_thus x A!x using "T◇"[THEN "→E"] by blast
5581next
5582  AOT_have x E!x using "thm-cont-e:3" .
5583  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5584  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5585  AOT_hence x E!x]a
5586    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5587  AOT_hence O!a
5588    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5589  AOT_hence ¬A!a using "oa-contingent:2"[THEN "≡E"(1)] by blast
5590  AOT_hence x ¬A!x using "∃I" by fast
5591  AOT_thus x ¬A!x using "T◇"[THEN "→E"] by blast
5592qed
5593
5594AOT_theorem "oa-contingent:7": O!-x  ¬A!-x
5595proof -
5596  AOT_have O!x  ¬A!x
5597    using "oa-contingent:2" by blast
5598  also AOT_have   A!-x
5599    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:2"].
5600  finally AOT_have 1: O!x  A!-x.
5601
5602  AOT_have A!x  ¬O!x
5603    using "oa-contingent:3" by blast
5604  also AOT_have   O!-x
5605    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:1"].
5606  finally AOT_have 2: A!x  O!-x.
5607
5608  AOT_show O!-x  ¬A!-x
5609    using 1[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "oa-contingent:3"[of _ x] 2[symmetric]
5610          "≡E"(5) by blast
5611qed
5612
5613AOT_theorem "oa-contingent:6": O!-  A!-
5614proof (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5615  AOT_assume 1: O!- = A!-
5616  fix x
5617  AOT_have A!-x  O!-x
5618    apply (rule "rule=E"[rotated, OF 1]) by (fact "oth-class-taut:3:a")
5619  AOT_hence A!-x  ¬A!-x
5620    using "oa-contingent:7" "≡E" by fast
5621  AOT_thus (A!-x  ¬A!-x) & ¬(A!-x  ¬A!-x) using "oth-class-taut:3:c" "&I" by blast
5622qed
5623
5624AOT_theorem "oa-contingent:8": Contingent(O!-)
5625  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:1", THEN "≡E"(1), OF "oa-contingent:4"].
5626
5627AOT_theorem "oa-contingent:9": Contingent(A!-)
5628  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:2", THEN "≡E"(1), OF "oa-contingent:5"].
5629
5630AOT_define WeaklyContingent :: ‹Π  φ› ("WeaklyContingent'(_')")
5631  "df-cont-nec": "WeaklyContingent([F]) df Contingent([F]) & x ([F]x  [F]x)"
5632
5633AOT_theorem "cont-nec-fact1:1": WeaklyContingent([F])  WeaklyContingent([F]-)
5634proof -
5635  AOT_have WeaklyContingent([F])  Contingent([F]) & x ([F]x  [F]x)
5636    using "df-cont-nec"[THEN "≡Df"] by blast
5637  also AOT_have ...  Contingent([F]-) & x ([F]x  [F]x)
5638    apply (rule "oth-class-taut:8:f"[THEN "≡E"(2)]; rule "→I")
5639    using "thm-cont-prop:3".
5640  also AOT_have   Contingent([F]-) & x ([F]-x  [F]-x)
5641  proof (rule "oth-class-taut:8:e"[THEN "≡E"(2)]; rule "→I"; rule "≡I"; rule "→I"; rule GEN; rule "→I")
5642    fix x
5643    AOT_assume 0: x ([F]x  [F]x)
5644    AOT_assume 1: [F]-x
5645    AOT_have ¬[F]x
5646      by (AOT_subst (reverse) ¬[F]x [F]-x)
5647         (auto simp add: "thm-relation-negation:1" 1)
5648    AOT_hence 2: ¬[F]x
5649      using "KBasic:11"[THEN "≡E"(2)] by blast
5650    AOT_show [F]-x
5651    proof (rule "raa-cor:1")
5652      AOT_assume 3: ¬[F]-x
5653      AOT_have ¬¬[F]x
5654        by (AOT_subst (reverse) ¬[F]x [F]-x)
5655           (auto simp add: "thm-relation-negation:1" 3)
5656      AOT_hence [F]x
5657        using "conventions:5"[THEN "≡dfI"] by simp
5658      AOT_hence [F]x using 0 "∀E" "→E" by fast
5659      AOT_thus [F]x & ¬[F]x using "&I" 2 by blast
5660    qed
5661  next
5662    fix x
5663    AOT_assume 0: x ([F]-x  [F]-x)
5664    AOT_assume 1: [F]x
5665    AOT_have ¬[F]-x
5666      by (AOT_subst ¬[F]-x [F]x)
5667         (auto simp: "thm-relation-negation:2" 1)
5668    AOT_hence 2: ¬[F]-x
5669      using "KBasic:11"[THEN "≡E"(2)] by blast
5670    AOT_show [F]x
5671    proof (rule "raa-cor:1")
5672      AOT_assume 3: ¬[F]x
5673      AOT_have ¬¬[F]-x
5674        by (AOT_subst ¬[F]-x [F]x)
5675           (auto simp add: "thm-relation-negation:2" 3)
5676      AOT_hence [F]-x
5677        using "conventions:5"[THEN "≡dfI"] by simp
5678      AOT_hence [F]-x using 0 "∀E" "→E" by fast
5679      AOT_thus [F]-x & ¬[F]-x using "&I" 2 by blast
5680    qed
5681  qed
5682  also AOT_have   WeaklyContingent([F]-)
5683    using "df-cont-nec"[THEN "≡Df", symmetric] by blast
5684  finally show ?thesis.
5685qed
5686
5687AOT_theorem "cont-nec-fact1:2": (WeaklyContingent([F]) & ¬WeaklyContingent([G]))  F  G
5688proof (rule "→I"; rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5689  AOT_assume 1: WeaklyContingent([F]) & ¬WeaklyContingent([G])
5690  AOT_hence WeaklyContingent([F]) using "&E" by blast
5691  moreover AOT_assume F = G
5692  ultimately AOT_have WeaklyContingent([G])
5693    using "rule=E" by blast
5694  AOT_thus WeaklyContingent([G]) & ¬WeaklyContingent([G])
5695    using 1 "&I" "&E" by blast
5696qed
5697
5698AOT_theorem "cont-nec-fact2:1": WeaklyContingent(O!)
5699proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5700  AOT_show Contingent(O!)
5701    using "oa-contingent:4".
5702next
5703  AOT_show x ([O!]x  [O!]x)
5704    apply (rule GEN; rule "→I")
5705    using "oa-facts:5"[THEN "≡E"(1)] by blast
5706qed
5707
5708
5709AOT_theorem "cont-nec-fact2:2": WeaklyContingent(A!)
5710proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5711  AOT_show Contingent(A!)
5712    using "oa-contingent:5".
5713next
5714  AOT_show x ([A!]x  [A!]x)
5715    apply (rule GEN; rule "→I")
5716    using "oa-facts:6"[THEN "≡E"(1)] by blast
5717qed
5718
5719AOT_theorem "cont-nec-fact2:3": ¬WeaklyContingent(E!)
5720proof (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5721       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "raa-cor:2")
5722  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst].
5723  AOT_hence x (E!x & ¬𝒜E!x) using "BF◇"[THEN "→E"] by blast
5724  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
5725  AOT_hence 1: E!a & ¬𝒜E!a using "KBasic2:3"[THEN "→E"] by simp
5726  moreover AOT_assume x ([E!]x  [E!]x)
5727  ultimately AOT_have E!a using "&E" "∀E" "→E" by fast
5728  AOT_hence 𝒜E!a using "nec-imp-act"[THEN "→E"] by blast
5729  AOT_hence 𝒜E!a using "qml-act:1"[axiom_inst, THEN "→E"] by blast
5730  moreover AOT_have ¬𝒜E!a using "KBasic:11"[THEN "≡E"(2)] 1[THEN "&E"(2)] by meson
5731  ultimately AOT_have 𝒜E!a & ¬𝒜E!a using "&I" by blast
5732  AOT_thus p & ¬p for p using "raa-cor:1" by blast
5733qed
5734
5735AOT_theorem "cont-nec-fact2:4": ¬WeaklyContingent(L)
5736  apply (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5737       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(1))
5738  apply (rule "contingent-properties:4"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
5739  apply (rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "useful-tautologies:2"[THEN "→E"])
5740  using "thm-noncont-e-e:3"[THEN "contingent-properties:3"[THEN "≡dfE"]].
5741
5742(* TODO: cleanup *)
5743AOT_theorem "cont-nec-fact2:5": O!  E! & O!  E!- & O!  L & O!  L-
5744proof -
5745  AOT_have 1: L
5746    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5747  {
5748    fix φ and Π Π' :: <κ>
5749    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5750    proof (rule "raa-cor:2")
5751      AOT_assume φ{Π'}  φ{Π}
5752      AOT_hence φ{Π'} using that(1) "≡E" by blast
5753      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5754    qed
5755    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5756      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5757  } note 0 = this
5758  show ?thesis
5759    apply(safe intro!: "&I"; rule 0)
5760    using "cqt:2[concrete]"[axiom_inst] apply blast
5761    using "oa-exist:1" apply blast
5762    using "cont-nec-fact2:3" apply fast
5763    apply (rule "useful-tautologies:2"[THEN "→E"])
5764    using "cont-nec-fact2:1" apply fast
5765    using "rel-neg-T:3" apply fast
5766    using "oa-exist:1" apply blast
5767    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5768    apply (rule "useful-tautologies:2"[THEN "→E"])
5769    using "cont-nec-fact2:1" apply blast
5770    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5771    using "oa-exist:1" apply fast
5772    using "cont-nec-fact2:4" apply fast
5773    apply (rule "useful-tautologies:2"[THEN "→E"])
5774    using "cont-nec-fact2:1" apply fast
5775    using "rel-neg-T:3" apply fast
5776    using "oa-exist:1" apply fast
5777    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5778    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5779    apply (rule "useful-tautologies:2"[THEN "→E"])
5780    using "cont-nec-fact2:1" by blast
5781qed
5782
5783(* TODO: cleanup together with above *)
5784AOT_theorem "cont-nec-fact2:6": A!  E! & A!  E!- & A!  L & A!  L-
5785proof -
5786  AOT_have 1: L
5787    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5788  {
5789    fix φ and Π Π' :: <κ>
5790    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5791    proof (rule "raa-cor:2")
5792      AOT_assume φ{Π'}  φ{Π}
5793      AOT_hence φ{Π'} using that(1) "≡E" by blast
5794      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5795    qed
5796    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5797      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5798  } note 0 = this
5799  show ?thesis
5800    apply(safe intro!: "&I"; rule 0)
5801    using "cqt:2[concrete]"[axiom_inst] apply blast
5802    using "oa-exist:2" apply blast
5803    using "cont-nec-fact2:3" apply fast
5804    apply (rule "useful-tautologies:2"[THEN "→E"])
5805    using "cont-nec-fact2:2" apply fast
5806    using "rel-neg-T:3" apply fast
5807    using "oa-exist:2" apply blast
5808    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5809    apply (rule "useful-tautologies:2"[THEN "→E"])
5810    using "cont-nec-fact2:2" apply blast
5811    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5812    using "oa-exist:2" apply fast
5813    using "cont-nec-fact2:4" apply fast
5814    apply (rule "useful-tautologies:2"[THEN "→E"])
5815    using "cont-nec-fact2:2" apply fast
5816    using "rel-neg-T:3" apply fast
5817    using "oa-exist:2" apply fast
5818    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5819    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5820    apply (rule "useful-tautologies:2"[THEN "→E"])
5821    using "cont-nec-fact2:2" by blast
5822qed
5823
5824AOT_define necessary_or_contingently_false :: ‹φ  φ› ("Δ_" [49] 54)
5825  Δp df p  (¬𝒜p & p)
5826
5827AOT_theorem sixteen:
5828 shows F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16 (
5829«F1::<κ>»  F2 & F1  F3 & F1  F4 & F1  F5 & F1  F6 & F1  F7 & F1  F8 & F1  F9 & F1  F10 & F1  F11 & F1  F12 & F1  F13 & F1  F14 & F1  F15 & F1  F16 &
5830F2  F3 & F2  F4 & F2  F5 & F2  F6 & F2  F7 & F2  F8 & F2  F9 & F2  F10 & F2  F11 & F2  F12 & F2  F13 & F2  F14 & F2  F15 & F2  F16 &
5831F3  F4 & F3  F5 & F3  F6 & F3  F7 & F3  F8 & F3  F9 & F3  F10 & F3  F11 & F3  F12 & F3  F13 & F3  F14 & F3  F15 & F3  F16 &
5832F4  F5 & F4  F6 & F4  F7 & F4  F8 & F4  F9 & F4  F10 & F4  F11 & F4  F12 & F4  F13 & F4  F14 & F4  F15 & F4  F16 &
5833F5  F6 & F5  F7 & F5  F8 & F5  F9 & F5  F10 & F5  F11 & F5  F12 & F5  F13 & F5  F14 & F5  F15 & F5  F16 &
5834F6  F7 & F6  F8 & F6  F9 & F6  F10 & F6  F11 & F6  F12 & F6  F13 & F6  F14 & F6  F15 & F6  F16 &
5835F7  F8 & F7  F9 & F7  F10 & F7  F11 & F7  F12 & F7  F13 & F7  F14 & F7  F15 & F7  F16 &
5836F8  F9 & F8  F10 & F8  F11 & F8  F12 & F8  F13 & F8  F14 & F8  F15 & F8  F16 &
5837F9  F10 & F9  F11 & F9  F12 & F9  F13 & F9  F14 & F9  F15 & F9  F16 &
5838F10  F11 & F10  F12 & F10  F13 & F10  F14 & F10  F15 & F10  F16 &
5839F11  F12 & F11  F13 & F11  F14 & F11  F15 & F11  F16 &
5840F12  F13 & F12  F14 & F12  F15 & F12  F16 &
5841F13  F14 & F13  F15 & F13  F16 &
5842F14  F15 & F14  F16 &
5843F15  F16) 
5844proof -
5845
5846  AOT_have Delta_pos: Δφ  φ for φ
5847  proof(rule "→I")
5848    AOT_assume Δφ
5849    AOT_hence φ  (¬𝒜φ & φ)
5850      using "≡dfE"[OF necessary_or_contingently_false] by blast
5851    moreover {
5852      AOT_assume φ
5853      AOT_hence φ
5854        by (metis "B◇" "T◇" "vdash-properties:10")
5855    }
5856    moreover {
5857      AOT_assume ¬𝒜φ & φ
5858      AOT_hence φ
5859        using "&E" by blast
5860    }
5861    ultimately AOT_show φ
5862      by (metis "∨E"(2) "raa-cor:1") 
5863  qed
5864
5865  AOT_have act_and_not_nec_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5866    using "≡dfE" "&E"(1) "∨E"(2) necessary_or_contingently_false "raa-cor:3" that(1) that(2) by blast
5867  AOT_have act_and_pos_not_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5868    using "KBasic:11" act_and_not_nec_not_delta "≡E"(2) that(1) that(2) by blast
5869  AOT_have impossible_delta: ¬Δφ if ¬φ for φ
5870    using Delta_pos "modus-tollens:1" that by blast
5871  AOT_have not_act_and_pos_delta: Δφ if ¬𝒜φ and φ for φ
5872    by (meson "≡dfI" "&I" "∨I"(2) necessary_or_contingently_false that(1) that(2))
5873  AOT_have nec_delta: Δφ if φ for φ
5874    using "≡dfI" "∨I"(1) necessary_or_contingently_false that by blast
5875
5876  AOT_obtain a where a_prop: A!a
5877    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5878  AOT_obtain b where b_prop: [E!]b & ¬𝒜[E!]b
5879    using "pos-not-pna:3" using "∃E"[rotated] by blast
5880
5881  AOT_have b_ord: [O!]b
5882  proof(rule "=dfI"(2)[OF AOT_ordinary])
5883    AOT_show x [E!]x] by "cqt:2[lambda]"
5884  next
5885    AOT_show x [E!]x]b
5886    proof (rule "β←C"(1); ("cqt:2[lambda]")?)
5887      AOT_show b by (rule "cqt:2[const_var]"[axiom_inst])
5888      AOT_show [E!]b by (fact b_prop[THEN "&E"(1)])
5889    qed
5890  qed
5891
5892  AOT_have nec_not_L_neg: ¬[L-]x for x
5893    using "thm-noncont-e-e:2" "contingent-properties:2"[THEN "≡dfE"] "&E"
5894          CBF[THEN "→E"] "∀E" by blast
5895  AOT_have nec_L: [L]x for x
5896    using "thm-noncont-e-e:1" "contingent-properties:1"[THEN "≡dfE"]
5897      CBF[THEN "→E"] "∀E" by blast
5898
5899  AOT_have act_ord_b: 𝒜[O!]b
5900    using b_ord "≡E"(1) "oa-facts:7" by blast
5901  AOT_have delta_ord_b: Δ[O!]b
5902    by (meson "≡dfI" b_ord "∨I"(1) necessary_or_contingently_false "oa-facts:1" "vdash-properties:10")
5903  AOT_have not_act_ord_a: ¬𝒜[O!]a
5904    by (meson a_prop "≡E"(1) "≡E"(3) "oa-contingent:3" "oa-facts:7")
5905  AOT_have not_delta_ord_a: ¬Δ[O!]a
5906    by (metis Delta_pos "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "reductio-aa:1" "vdash-properties:10")
5907
5908  AOT_have not_act_abs_b: ¬𝒜[A!]b
5909    by (meson b_ord "≡E"(1) "≡E"(3) "oa-contingent:2" "oa-facts:8")
5910  AOT_have not_delta_abs_b: ¬Δ[A!]b
5911  proof(rule "raa-cor:2")
5912    AOT_assume Δ[A!]b
5913    AOT_hence [A!]b
5914      by (metis Delta_pos "vdash-properties:10")
5915    AOT_thus [A!]b & ¬[A!]b
5916      by (metis b_ord "&I" "≡E"(1) "oa-contingent:2" "oa-facts:4" "vdash-properties:10")
5917  qed
5918  AOT_have act_abs_a: 𝒜[A!]a
5919    using a_prop "≡E"(1) "oa-facts:8" by blast
5920  AOT_have delta_abs_a: Δ[A!]a
5921      by (metis "≡dfI" a_prop "oa-facts:2" "vdash-properties:10" "∨I"(1) necessary_or_contingently_false)
5922
5923  AOT_have not_act_concrete_b: ¬𝒜[E!]b
5924    using b_prop "&E"(2) by blast
5925  AOT_have delta_concrete_b: Δ[E!]b
5926  proof (rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5927    AOT_show ¬𝒜[E!]b using b_prop "&E"(2) by blast
5928  next
5929    AOT_show [E!]b using b_prop "&E"(1) by blast
5930  qed
5931  AOT_have not_act_concrete_a: ¬𝒜[E!]a
5932  proof (rule "raa-cor:2")
5933    AOT_assume 𝒜[E!]a
5934    AOT_hence 1: [E!]a by (metis "Act-Sub:3" "vdash-properties:10")
5935    AOT_have [A!]a by (simp add: a_prop)
5936    AOT_hence x ¬[E!]x]a
5937      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5938    AOT_hence ¬[E!]a using "β→C"(1) by blast
5939    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5940  qed
5941  AOT_have not_delta_concrete_a: ¬Δ[E!]a
5942  proof (rule "raa-cor:2")
5943    AOT_assume Δ[E!]a
5944    AOT_hence 1: [E!]a by (metis Delta_pos "vdash-properties:10")
5945    AOT_have [A!]a by (simp add: a_prop)
5946    AOT_hence x ¬[E!]x]a
5947      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5948    AOT_hence ¬[E!]a using "β→C"(1) by blast
5949    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5950  qed
5951
5952  AOT_have not_act_q_zero: ¬𝒜q0
5953    by (meson "log-prop-prop:2" "pos-not-pna:1" q0_def "reductio-aa:1" "rule-id-df:2:a[zero]")
5954  AOT_have delta_q_zero: Δq0
5955  proof(rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5956    AOT_show ¬𝒜q0 using not_act_q_zero.
5957    AOT_show q0 by (meson "&E"(1) q0_prop)
5958  qed
5959  AOT_have act_not_q_zero: 𝒜¬q0 using "Act-Basic:1" "∨E"(2) not_act_q_zero by blast
5960  AOT_have not_delta_not_q_zero: ¬Δ¬q0
5961      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta "&E"(1) "∨E"(2) not_act_q_zero q0_prop by blast
5962
5963  AOT_have [L-] by (simp add: "rel-neg-T:3")
5964  moreover AOT_have ¬𝒜[L-]b & ¬Δ[L-]b & ¬𝒜[L-]a & ¬Δ[L-]a
5965  proof (safe intro!: "&I")
5966    AOT_show ¬𝒜[L-]b by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5967    AOT_show ¬Δ[L-]b by (meson Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg)
5968    AOT_show ¬𝒜[L-]a by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5969    AOT_show ¬Δ[L-]a using Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg by blast
5970  qed
5971  ultimately AOT_obtain F0 where ¬𝒜[F0]b & ¬Δ[F0]b & ¬𝒜[F0]a & ¬Δ[F0]a
5972    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5973  AOT_hence ¬𝒜[F0]b and ¬Δ[F0]b and ¬𝒜[F0]a and ¬Δ[F0]a
5974    using "&E" by blast+
5975  note props = this
5976
5977  let  = "«y [A!]y & q0]»"
5978  AOT_modally_strict {
5979    AOT_have [«»] by "cqt:2[lambda]"
5980  } note 1 = this
5981  moreover AOT_have¬𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
5982  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5983    AOT_show ¬𝒜([A!]b & q0)
5984      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
5985  next AOT_show ¬Δ([A!]b & q0)
5986      by (metis Delta_pos "KBasic2:3" "&E"(1) "≡E"(4) not_act_abs_b "oa-facts:4" "oa-facts:8" "raa-cor:3" "vdash-properties:10")
5987  next AOT_show ¬𝒜([A!]a & q0)
5988      using "Act-Basic:2" "&E"(2) "≡E"(1) not_act_q_zero "raa-cor:3" by blast
5989  next AOT_show Δ([A!]a & q0)
5990    proof (rule not_act_and_pos_delta)
5991      AOT_show ¬𝒜([A!]a & q0)
5992        using "Act-Basic:2" "&E"(2) "≡E"(4) not_act_q_zero "raa-cor:3" by blast
5993    next AOT_show ([A!]a & q0)
5994        by (metis "&I" "→E" Delta_pos "KBasic:16" "&E"(1) delta_abs_a "≡E"(1) "oa-facts:6" q0_prop)
5995    qed
5996  qed
5997  ultimately AOT_obtain F1 where ¬𝒜[F1]b & ¬Δ[F1]b & ¬𝒜[F1]a & Δ[F1]a
5998    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5999  AOT_hence ¬𝒜[F1]b and ¬Δ[F1]b and ¬𝒜[F1]a and Δ[F1]a
6000    using "&E" by blast+
6001  note props = props this
6002
6003  let  = "«y [A!]y & ¬q0]»"
6004  AOT_modally_strict {
6005    AOT_have [«»] by "cqt:2[lambda]"
6006  } note 1 = this
6007  moreover AOT_have ¬𝒜[«»]b & ¬Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6008  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6009    AOT_show ¬𝒜([A!]b & ¬q0)
6010      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
6011  next AOT_show ¬Δ([A!]b & ¬q0)
6012      by (meson "RM◇" Delta_pos "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b "oa-facts:4" "oa-facts:8")
6013  next AOT_show 𝒜([A!]a & ¬q0)
6014      by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
6015  next AOT_show ¬Δ([A!]a & ¬q0)
6016    proof (rule act_and_not_nec_not_delta)
6017      AOT_show 𝒜([A!]a & ¬q0)
6018        by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
6019    next
6020      AOT_show ¬([A!]a & ¬q0)
6021        by (metis "KBasic2:1" "KBasic:3" "&E"(1) "&E"(2) "≡E"(4) q0_prop "raa-cor:3")
6022    qed
6023  qed
6024  ultimately AOT_obtain F2 where ¬𝒜[F2]b & ¬Δ[F2]b & 𝒜[F2]a & ¬Δ[F2]a
6025    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6026  AOT_hence ¬𝒜[F2]b and ¬Δ[F2]b and 𝒜[F2]a and ¬Δ[F2]a
6027    using "&E" by blast+
6028  note props = props this
6029
6030  AOT_have abstract_prop: ¬𝒜[A!]b & ¬Δ[A!]b & 𝒜[A!]a & Δ[A!]a
6031    using act_abs_a "&I" delta_abs_a not_act_abs_b not_delta_abs_b by presburger
6032  then AOT_obtain F3 where ¬𝒜[F3]b & ¬Δ[F3]b & 𝒜[F3]a & Δ[F3]a
6033    using "∃I"(1)[rotated, THEN "∃E"[rotated]] "oa-exist:2" by fastforce
6034  AOT_hence ¬𝒜[F3]b and ¬Δ[F3]b and 𝒜[F3]a and Δ[F3]a
6035    using "&E" by blast+
6036  note props = props this
6037
6038  AOT_have ¬𝒜[E!]b & Δ[E!]b & ¬𝒜[E!]a & ¬Δ[E!]a
6039    by (meson "&I" delta_concrete_b not_act_concrete_a not_act_concrete_b not_delta_concrete_a)
6040  then AOT_obtain F4 where ¬𝒜[F4]b & Δ[F4]b & ¬𝒜[F4]a & ¬Δ[F4]a
6041    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6042  AOT_hence ¬𝒜[F4]b and Δ[F4]b and ¬𝒜[F4]a and ¬Δ[F4]a
6043    using "&E" by blast+
6044  note props = props this
6045
6046  AOT_modally_strict {
6047    AOT_have y q0] by "cqt:2[lambda]"
6048  } note 1 = this
6049  moreover AOT_have ¬𝒜y q0]b & Δy q0]b & ¬𝒜y q0]a & Δy q0]a
6050    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6051       (auto simp: not_act_q_zero delta_q_zero)
6052  ultimately AOT_obtain F5 where ¬𝒜[F5]b & Δ[F5]b & ¬𝒜[F5]a & Δ[F5]a
6053    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6054  AOT_hence ¬𝒜[F5]b and Δ[F5]b and ¬𝒜[F5]a and Δ[F5]a
6055    using "&E" by blast+
6056  note props = props this
6057
6058  let  = "«y [E!]y  ([A!]y & ¬q0)]»"
6059  AOT_modally_strict {
6060    AOT_have [«»] by "cqt:2[lambda]"
6061  } note 1 = this
6062  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6063  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6064    AOT_have 𝒜¬([A!]b & ¬q0)
6065      by (metis "Act-Basic:1" "Act-Basic:2" abstract_prop "&E"(1) "∨E"(2)
6066                "≡E"(1) "raa-cor:3")
6067    moreover AOT_have ¬𝒜[E!]b
6068      using b_prop "&E"(2) by blast
6069    ultimately AOT_have 2: 𝒜(¬[E!]b & ¬([A!]b & ¬q0))
6070      by (metis "Act-Basic:2" "Act-Sub:1" "&I" "≡E"(3) "raa-cor:1")
6071    AOT_have 𝒜¬([E!]b  ([A!]b & ¬q0))
6072      by (AOT_subst ¬([E!]b  ([A!]b & ¬q0)) ¬[E!]b & ¬([A!]b & ¬q0))
6073         (auto simp: "oth-class-taut:5:d" 2)
6074    AOT_thus ¬𝒜([E!]b  ([A!]b & ¬q0))
6075      by (metis "¬¬I" "Act-Sub:1" "≡E"(4))
6076  next
6077    AOT_show Δ([E!]b  ([A!]b & ¬q0))
6078    proof (rule not_act_and_pos_delta)
6079      AOT_show ¬𝒜([E!]b  ([A!]b & ¬q0))
6080        by (metis "Act-Basic:2" "Act-Basic:9" "∨E"(2) "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b not_act_concrete_b "raa-cor:3")
6081    next
6082      AOT_show ([E!]b  ([A!]b & ¬q0))
6083        using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
6084    qed
6085  next AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
6086      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
6087  next AOT_show ¬Δ([E!]a  ([A!]a & ¬q0))
6088    proof (rule act_and_not_nec_not_delta)
6089      AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
6090        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
6091    next
6092      AOT_have ¬[E!]a
6093        by (metis "≡dfI" "conventions:5" "&I" "∨I"(2) necessary_or_contingently_false not_act_concrete_a not_delta_concrete_a "raa-cor:3")
6094      moreover AOT_have ¬([A!]a & ¬q0)
6095        by (metis "KBasic2:1" "KBasic:11" "KBasic:3" "&E"(1) "&E"(2) "≡E"(1) q0_prop "raa-cor:3")
6096      ultimately AOT_have (¬[E!]a & ¬([A!]a & ¬q0)) by (metis "KBasic:16" "&I" "vdash-properties:10")
6097      AOT_hence ¬([E!]a  ([A!]a & ¬q0))
6098        by (metis "RE◇" "≡E"(2) "oth-class-taut:5:d")
6099      AOT_thus ¬([E!]a  ([A!]a & ¬q0)) by (metis "KBasic:12" "≡E"(1) "raa-cor:3")
6100    qed
6101  qed
6102  ultimately AOT_obtain F6 where ¬𝒜[F6]b & Δ[F6]b & 𝒜[F6]a & ¬Δ[F6]a
6103    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6104  AOT_hence ¬𝒜[F6]b and Δ[F6]b and 𝒜[F6]a and ¬Δ[F6]a
6105    using "&E" by blast+
6106  note props = props this
6107
6108  let  = "«y [A!]y  [E!]y]»"
6109  AOT_modally_strict {
6110    AOT_have [«»] by "cqt:2[lambda]"
6111  } note 1 = this
6112  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & Δ[«»]a
6113  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6114    AOT_show ¬𝒜([A!]b  [E!]b)
6115      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6116  next AOT_show Δ([A!]b  [E!]b)
6117    proof (rule not_act_and_pos_delta)
6118      AOT_show ¬𝒜([A!]b  [E!]b)
6119        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6120    next AOT_show ([A!]b  [E!]b)
6121        using "KBasic2:2" b_prop "&E"(1) "∨I"(2) "≡E"(2) by blast
6122    qed
6123  next AOT_show 𝒜([A!]a  [E!]a)
6124      by (meson "Act-Basic:9" act_abs_a "∨I"(1) "≡E"(2))
6125  next AOT_show Δ([A!]a  [E!]a)
6126    proof (rule nec_delta)
6127      AOT_show ([A!]a  [E!]a)
6128        by (metis "KBasic:15" act_abs_a act_and_not_nec_not_delta "Disjunction Addition"(1) delta_abs_a "raa-cor:3" "vdash-properties:10")
6129    qed
6130  qed
6131  ultimately AOT_obtain F7 where ¬𝒜[F7]b & Δ[F7]b & 𝒜[F7]a & Δ[F7]a
6132    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6133  AOT_hence ¬𝒜[F7]b and Δ[F7]b and 𝒜[F7]a and Δ[F7]a
6134    using "&E" by blast+
6135  note props = props this
6136
6137  let  = "«y [O!]y & ¬[E!]y]»"
6138  AOT_modally_strict {
6139    AOT_have [«»] by "cqt:2[lambda]"
6140  } note 1 = this
6141  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & ¬Δ[«»]a
6142  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6143    AOT_show 𝒜([O!]b & ¬[E!]b)
6144      by (metis "Act-Basic:1" "Act-Basic:2" act_ord_b "&I" "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:3")
6145  next AOT_show ¬Δ([O!]b & ¬[E!]b)
6146      by (metis (no_types, hide_lams) "conventions:5" "Act-Sub:1" "RM:1" act_and_not_nec_not_delta "act-conj-act:3"
6147                act_ord_b b_prop "&I" "&E"(1) "Conjunction Simplification"(2) "df-rules-formulas[3]"
6148                "≡E"(3) "raa-cor:1" "→E")
6149  next AOT_show ¬𝒜([O!]a & ¬[E!]a)
6150      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_ord_a "raa-cor:3" by blast
6151  next AOT_have ¬([O!]a & ¬[E!]a)
6152      by (metis "KBasic2:3" "&E"(1) "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "raa-cor:3" "vdash-properties:10")
6153    AOT_thus ¬Δ([O!]a & ¬[E!]a)
6154      by (rule impossible_delta)
6155  qed      
6156  ultimately AOT_obtain F8 where 𝒜[F8]b & ¬Δ[F8]b & ¬𝒜[F8]a & ¬Δ[F8]a
6157    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6158  AOT_hence 𝒜[F8]b and ¬Δ[F8]b and ¬𝒜[F8]a and ¬Δ[F8]a
6159    using "&E" by blast+
6160  note props = props this
6161
6162  (* TODO_PLM: binary property 9 wrong in PLM *)
6163  let  = "«y ¬[E!]y & ([O!]y  q0)]»"
6164  AOT_modally_strict {
6165    AOT_have [«»] by "cqt:2[lambda]"
6166  } note 1 = this
6167  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6168  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6169    AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6170      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6171                "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6172  next AOT_show ¬Δ(¬[E!]b & ([O!]b  q0))
6173    proof (rule act_and_pos_not_not_delta)
6174      AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6175        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6176                  "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6177    next
6178      AOT_show ¬(¬[E!]b & ([O!]b  q0))
6179      proof (AOT_subst ¬(¬[E!]b & ([O!]b  q0)) [E!]b  ¬([O!]b  q0))
6180        AOT_modally_strict {
6181          AOT_show ¬(¬[E!]b & ([O!]b  q0))  [E!]b  ¬([O!]b  q0)
6182            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2) "∨E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
6183        }
6184      next
6185        AOT_show ([E!]b  ¬([O!]b  q0))
6186          using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
6187       qed
6188     qed
6189   next
6190     AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6191       using "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2" by blast
6192   next
6193     AOT_show Δ(¬[E!]a & ([O!]a  q0))
6194     proof (rule not_act_and_pos_delta)
6195       AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6196         by (metis "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2")
6197     next
6198       AOT_have ¬[E!]a
6199         using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "raa-cor:5" by blast
6200       moreover AOT_have ([O!]a  q0)
6201         by (metis "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(3) q0_prop "raa-cor:3")
6202       ultimately AOT_show (¬[E!]a & ([O!]a  q0))
6203         by (metis "KBasic:16" "&I" "vdash-properties:10")
6204     qed
6205   qed
6206  ultimately AOT_obtain F9 where 𝒜[F9]b & ¬Δ[F9]b & ¬𝒜[F9]a & Δ[F9]a
6207    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6208  AOT_hence 𝒜[F9]b and ¬Δ[F9]b and ¬𝒜[F9]a and Δ[F9]a
6209    using "&E" by blast+
6210  note props = props this
6211
6212  AOT_modally_strict {
6213    AOT_have y ¬q0] by "cqt:2[lambda]"
6214  } note 1 = this
6215  moreover AOT_have 𝒜y ¬q0]b & ¬Δy ¬q0]b & 𝒜y ¬q0]a & ¬Δy ¬q0]a
6216    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1]; auto simp: act_not_q_zero not_delta_not_q_zero)
6217  ultimately AOT_obtain F10 where 𝒜[F10]b & ¬Δ[F10]b & 𝒜[F10]a & ¬Δ[F10]a
6218    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6219  AOT_hence 𝒜[F10]b and ¬Δ[F10]b and 𝒜[F10]a and ¬Δ[F10]a
6220    using "&E" by blast+
6221  note props = props this
6222
6223  AOT_modally_strict {
6224    AOT_have y ¬[E!]y] by "cqt:2[lambda]"
6225  } note 1 = this
6226  moreover AOT_have 𝒜y ¬[E!]y]b & ¬Δy ¬[E!]y]b & 𝒜y ¬[E!]y]a & Δy ¬[E!]y]a
6227  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6228    AOT_show 𝒜¬[E!]b
6229      using "Act-Basic:1" "∨E"(2) not_act_concrete_b by blast
6230  next AOT_show ¬Δ¬[E!]b
6231      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta b_prop "&E"(1) "∨E"(2) not_act_concrete_b by blast
6232  next AOT_show 𝒜¬[E!]a
6233      using "Act-Basic:1" "∨E"(2) not_act_concrete_a by blast
6234  next AOT_show Δ¬[E!]a
6235      using "KBasic2:1" "≡E"(2) nec_delta not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "reductio-aa:1" by blast
6236  qed
6237  ultimately AOT_obtain F11 where 𝒜[F11]b & ¬Δ[F11]b & 𝒜[F11]a & Δ[F11]a
6238    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6239  AOT_hence 𝒜[F11]b and ¬Δ[F11]b and 𝒜[F11]a and Δ[F11]a
6240    using "&E" by blast+
6241  note props = props this
6242
6243  AOT_have 𝒜[O!]b & Δ[O!]b & ¬𝒜[O!]a & ¬Δ[O!]a
6244    by (simp add: act_ord_b "&I" delta_ord_b not_act_ord_a not_delta_ord_a)
6245  then AOT_obtain F12 where 𝒜[F12]b & Δ[F12]b & ¬𝒜[F12]a & ¬Δ[F12]a
6246    using "oa-exist:1" "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6247  AOT_hence 𝒜[F12]b and Δ[F12]b and ¬𝒜[F12]a and ¬Δ[F12]a
6248    using "&E" by blast+
6249  note props = props this
6250
6251  let  = "«y [O!]y  q0]»"
6252  AOT_modally_strict {
6253    AOT_have [«»] by "cqt:2[lambda]"
6254  } note 1 = this
6255  moreover AOT_have 𝒜[«»]b & Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6256  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6257    AOT_show 𝒜([O!]b  q0)
6258      by (meson "Act-Basic:9" act_ord_b "∨I"(1) "≡E"(2))
6259  next AOT_show Δ([O!]b  q0)
6260      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6261  next AOT_show ¬𝒜([O!]a  q0)
6262      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6263  next AOT_show Δ([O!]a  q0)
6264    proof (rule not_act_and_pos_delta)
6265      AOT_show ¬𝒜([O!]a  q0)
6266        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6267    next AOT_show ([O!]a  q0)
6268        using "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(2) q0_prop by blast
6269    qed
6270  qed
6271  ultimately AOT_obtain F13 where 𝒜[F13]b & Δ[F13]b & ¬𝒜[F13]a & Δ[F13]a
6272    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6273  AOT_hence 𝒜[F13]b and Δ[F13]b and ¬𝒜[F13]a and Δ[F13]a
6274    using "&E" by blast+
6275  note props = props this
6276
6277  let  = "«y [O!]y  ¬q0]»"
6278  AOT_modally_strict {
6279     AOT_have [«»] by "cqt:2[lambda]"
6280  } note 1 = this
6281  moreover AOT_have 𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6282  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6283    AOT_show 𝒜([O!]b  ¬q0)
6284      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6285  next AOT_show Δ([O!]b  ¬q0)
6286      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6287  next AOT_show 𝒜([O!]a  ¬q0)
6288      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6289  next AOT_show ¬Δ([O!]a  ¬q0)
6290    proof(rule act_and_pos_not_not_delta)
6291      AOT_show 𝒜([O!]a  ¬q0)
6292        by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6293    next
6294      AOT_have ¬[O!]a
6295        using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_ord_a not_delta_ord_a "raa-cor:6" by blast
6296      moreover AOT_have q0
6297        by (meson "&E"(1) q0_prop)
6298      ultimately AOT_have 2: (¬[O!]a & q0)
6299         by (metis "KBasic:16" "&I" "vdash-properties:10")
6300      AOT_show ¬([O!]a  ¬q0)
6301      proof (AOT_subst (reverse) ¬([O!]a  ¬q0) ¬[O!]a & q0)
6302        AOT_modally_strict {
6303          AOT_show ¬[O!]a & q0  ¬([O!]a  ¬q0)
6304            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2)
6305                      "∨E"(3) "deduction-theorem" "≡I" "raa-cor:3")
6306        }
6307      next
6308        AOT_show (¬[O!]a & q0)
6309          using "2" by blast
6310      qed
6311    qed
6312  qed
6313  ultimately AOT_obtain F14 where 𝒜[F14]b & Δ[F14]b & 𝒜[F14]a & ¬Δ[F14]a
6314    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6315  AOT_hence 𝒜[F14]b and Δ[F14]b and 𝒜[F14]a and ¬Δ[F14]a
6316    using "&E" by blast+
6317  note props = props this
6318
6319  AOT_have [L]
6320    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
6321  moreover AOT_have 𝒜[L]b & Δ[L]b & 𝒜[L]a & Δ[L]a
6322  proof (safe intro!: "&I")
6323    AOT_show 𝒜[L]b
6324      by (meson nec_L "nec-imp-act" "vdash-properties:10")
6325    next AOT_show Δ[L]b using nec_L nec_delta by blast
6326    next AOT_show 𝒜[L]a by (meson nec_L "nec-imp-act" "vdash-properties:10")
6327    next AOT_show Δ[L]a using nec_L nec_delta by blast
6328  qed
6329  ultimately AOT_obtain F15 where 𝒜[F15]b & Δ[F15]b & 𝒜[F15]a & Δ[F15]a
6330    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6331  AOT_hence 𝒜[F15]b and Δ[F15]b and 𝒜[F15]a and Δ[F15]a
6332    using "&E" by blast+
6333  note props = props this
6334
6335  show ?thesis
6336    by (rule "∃I"(2)[where β=F0]; rule "∃I"(2)[where β=F1]; rule "∃I"(2)[where β=F2];
6337           rule "∃I"(2)[where β=F3]; rule "∃I"(2)[where β=F4]; rule "∃I"(2)[where β=F5];
6338           rule "∃I"(2)[where β=F6]; rule "∃I"(2)[where β=F7]; rule "∃I"(2)[where β=F8];
6339           rule "∃I"(2)[where β=F9]; rule "∃I"(2)[where β=F10]; rule "∃I"(2)[where β=F11];
6340           rule "∃I"(2)[where β=F12]; rule "∃I"(2)[where β=F13]; rule "∃I"(2)[where β=F14];
6341           rule "∃I"(2)[where β=F15]; safe intro!: "&I")
6342       (match conclusion in "[?v  [F]  [G]]" for F G  6343        match props in A: "[?v  ¬φ{F}]" for φ 6344        match (φ) in "λa . ?p" fail¦ "λa . a" fail¦ _ 6345        match props in B: "[?v  φ{G}]" 6346        fact "pos-not-equiv-ne:4"[where F=F and G=G and φ=φ, THEN "→E",
6347                                OF "oth-class-taut:4:h"[THEN "≡E"(2)],
6348                                OF "Disjunction Addition"(2)[THEN "→E"],
6349                                OF "&I", OF A, OF B]››››)+
6350qed
6351
6352AOT_theorem "o-objects-exist:1": x O!x
6353proof(rule RN)
6354  AOT_modally_strict {
6355    AOT_obtain a where (E!a & ¬𝒜[E!]a)
6356      using "∃E"[rotated, OF "qml:4"[axiom_inst, THEN "BF◇"[THEN "→E"]]] by blast
6357    AOT_hence 1: E!a by (metis "KBasic2:3" "&E"(1) "→E")
6358    AOT_have x [E!]x]a
6359    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6360      AOT_show a using "cqt:2[const_var]"[axiom_inst] by blast
6361    next
6362      AOT_show E!a by (fact 1)
6363    qed
6364    AOT_hence O!a by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6365    AOT_thus x [O!]x by (rule "∃I")
6366  }
6367qed
6368
6369AOT_theorem "o-objects-exist:2": x A!x
6370proof (rule RN)
6371  AOT_modally_strict {
6372    AOT_obtain a where [A!]a
6373      using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
6374    AOT_thus x A!x using "∃I" by blast
6375  }
6376qed
6377
6378AOT_theorem "o-objects-exist:3": ¬x O!x
6379  by (rule RN) (metis (no_types, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(4) "modus-tollens:1" "o-objects-exist:2" "oa-contingent:2" "qml:2"[axiom_inst] "reductio-aa:2")
6380
6381AOT_theorem "o-objects-exist:4": ¬x A!x
6382  by (rule RN) (metis (mono_tags, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(1) "modus-tollens:1" "o-objects-exist:1" "oa-contingent:2" "qml:2"[axiom_inst] "→E")
6383
6384AOT_theorem "o-objects-exist:5": ¬x E!x
6385proof (rule RN; rule "raa-cor:2")
6386  AOT_modally_strict {
6387    AOT_assume x E!x
6388    moreover AOT_obtain a where abs: A!a
6389      using "o-objects-exist:2"[THEN "qml:2"[axiom_inst, THEN "→E"]] "∃E"[rotated] by blast
6390    ultimately AOT_have E!a using "∀E" by blast
6391    AOT_hence 1: E!a by (metis "T◇" "→E")
6392    AOT_have y E!y]a
6393    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6394      AOT_show a using "cqt:2[const_var]"[axiom_inst].
6395    next
6396      AOT_show E!a by (fact 1)
6397    qed
6398    AOT_hence O!a
6399      by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6400    AOT_hence ¬A!a by (metis "≡E"(1) "oa-contingent:2") 
6401    AOT_thus p & ¬p for p using abs by (metis "raa-cor:3")
6402  }
6403qed
6404
6405AOT_theorem partition: ¬x (O!x & A!x)
6406proof(rule "raa-cor:2")
6407  AOT_assume x (O!x & A!x)
6408  then AOT_obtain a where O!a & A!a using "∃E"[rotated] by blast
6409  AOT_thus p & ¬p for p by (metis "&E"(1) "Conjunction Simplification"(2) "≡E"(1) "modus-tollens:1" "oa-contingent:2" "raa-cor:3")
6410qed
6411
6412AOT_define eq_E :: ‹Π› ("'(=E')") "=E": (=E) =df xy O!x & O!y & F ([F]x  [F]y)]
6413
6414syntax "_AOT_eq_E_infix" :: ‹τ  τ  φ› (infixl "=E" 50)
6415translations
6416  "_AOT_eq_E_infix κ κ'" == "CONST AOT_exe (CONST eq_E) (CONST Pair κ κ')"
6417(* TODO: try to replace by a simple translations pattern *)
6418print_translation6419AOT_syntax_print_translations
6420[(const_syntax‹AOT_exe›, fn ctxt => fn [
6421  Const ("constAOT_PLM.eq_E", _),
6422  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6423] => Const (syntax_const‹_AOT_eq_E_infix›, dummyT) $ lhs $ rhs)]
6424
6425text‹Note: Not explicitly mentioned as theorem in PLM.›
6426AOT_theorem "=E[denotes]": [(=E)]
6427  by (rule "=dfI"(2)[OF "=E"]) "cqt:2[lambda]"+
6428
6429AOT_theorem "=E-simple:1": x =E y  (O!x & O!y & F ([F]x  [F]y))
6430proof -
6431  (* TODO: rethink the product hacks *)
6432  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6433    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6434  AOT_have 1: xy [O!]x & [O!]y & F ([F]x  [F]y)] by "cqt:2[lambda]"
6435  show ?thesis apply (rule "=dfI"(2)[OF "=E"]; "cqt:2[lambda]"?)
6436    using "beta-C-meta"[THEN "→E", OF 1, unvarify ν1νn, of "(AOT_term_of_var x,AOT_term_of_var y)", OF 0]
6437    by fast
6438qed
6439
6440AOT_theorem "=E-simple:2": x =E y  x = y
6441proof (rule "→I")
6442  AOT_assume x =E y
6443  AOT_hence O!x & O!y & F ([F]x  [F]y) using "=E-simple:1"[THEN "≡E"(1)] by blast
6444  AOT_thus x = y
6445    using "≡dfI"[OF "identity:1"] "∨I" by blast
6446qed
6447
6448AOT_theorem "id-nec3:1": x =E y  (x =E y)
6449proof (rule "≡I"; rule "→I")
6450  AOT_assume x =E y
6451  AOT_hence O!x & O!y & F ([F]x  [F]y)
6452    using "=E-simple:1" "≡E" by blast
6453  AOT_hence O!x & O!y & F ([F]x  [F]y)
6454    by (metis "S5Basic:6" "&I" "&E"(1) "&E"(2) "≡E"(4) "oa-facts:1" "raa-cor:3" "vdash-properties:10")
6455  AOT_hence (O!x & O!y & F ([F]x  [F]y))
6456    by (metis "&E"(1) "&E"(2) "≡E"(2) "KBasic:3" "&I")
6457  AOT_thus (x =E y)
6458    using "=E-simple:1"
6459    by (AOT_subst x =E y O!x & O!y & F ([F]x  [F]y)) auto
6460next
6461  AOT_assume (x =E y)
6462  AOT_thus x =E y using "qml:2"[axiom_inst, THEN "→E"] by blast
6463qed
6464
6465AOT_theorem "id-nec3:2": (x =E y)  x =E y
6466  by (meson "RE◇" "S5Basic:2" "id-nec3:1" "≡E"(1) "≡E"(5) "Commutativity of ≡")
6467
6468AOT_theorem "id-nec3:3": (x =E y)  (x =E y)
6469  by (meson "id-nec3:1" "id-nec3:2" "≡E"(5))
6470
6471syntax "_AOT_non_eq_E" :: ‹Π› ("'(≠E')")
6472translations
6473  (Π) "(≠E)" == (Π) "(=E)-"
6474syntax "_AOT_non_eq_E_infix" :: ‹τ  τ  φ› (infixl "E" 50)
6475translations
6476 "_AOT_non_eq_E_infix κ κ'" == "CONST AOT_exe (CONST relation_negation (CONST eq_E)) (CONST Pair κ κ')"
6477(* TODO: try replacing be a simple translations pattern *)
6478print_translation6479AOT_syntax_print_translations
6480[(const_syntax‹AOT_exe›, fn ctxt => fn [
6481  Const (const_syntax‹relation_negation›, _) $ Const ("constAOT_PLM.eq_E", _),
6482  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6483] => Const (syntax_const‹_AOT_non_eq_E_infix›, dummyT) $ lhs $ rhs)]
6484AOT_theorem "thm-neg=E": x E y  ¬(x =E y)
6485proof -
6486  (* TODO: rethink the product hacks *)
6487  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6488    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6489  AOT_have θ: x1...x2 ¬(=E)x1...x2] by "cqt:2[lambda]" (* TODO_PLM: convoluted proof in PLM; TODO: product hack *)
6490  AOT_have x E y  x1...x2 ¬(=E)x1...x2]xy
6491    by (rule "=dfI"(1)[OF "df-relation-negation", OF θ])
6492       (meson "oth-class-taut:3:a")
6493  also AOT_have   ¬(=E)xy
6494    apply (rule "beta-C-meta"[THEN "→E", unvarify ν1νn])
6495     apply "cqt:2[lambda]"
6496    by (fact 0)
6497  finally show ?thesis.
6498qed
6499
6500AOT_theorem "id-nec4:1": x E y  (x E y)
6501proof -
6502  AOT_have x E y  ¬(x =E y) using "thm-neg=E".
6503  also AOT_have   ¬(x =E y)
6504    by (meson "id-nec3:2" "≡E"(1) "Commutativity of ≡" "oth-class-taut:4:b")
6505  also AOT_have   ¬(x =E y)
6506    by (meson "KBasic2:1" "≡E"(2) "Commutativity of ≡")
6507  also AOT_have   (x E y)
6508    by (AOT_subst (reverse) ¬(x =E y) x E y)
6509       (auto simp: "thm-neg=E" "oth-class-taut:3:a")
6510  finally show ?thesis.
6511qed
6512
6513AOT_theorem "id-nec4:2": (x E y)  (x E y)
6514  by (meson "RE◇" "S5Basic:2" "id-nec4:1" "≡E"(2) "≡E"(5) "Commutativity of ≡")
6515
6516AOT_theorem "id-nec4:3": (x E y)  (x E y)
6517  by (meson "id-nec4:1" "id-nec4:2" "≡E"(5))
6518
6519AOT_theorem "id-act2:1": x =E y  𝒜x =E y
6520  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec3:2" "≡E"(1) "≡E"(6))
6521AOT_theorem "id-act2:2": x E y  𝒜x E y
6522  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec4:2" "≡E"(1) "≡E"(6))
6523
6524AOT_theorem "ord=Eequiv:1": O!x  x =E x
6525proof (rule "→I")
6526  AOT_assume 1: O!x
6527  AOT_show x =E x
6528    apply (rule "=dfI"(2)[OF "=E"]) apply "cqt:2[lambda]"
6529    apply (rule "β←C"(1))
6530      apply "cqt:2[lambda]"
6531     apply (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6532    by (simp add: "1" RN "&I" "oth-class-taut:3:a" "universal-cor")
6533qed
6534
6535AOT_theorem "ord=Eequiv:2": x =E y  y =E x
6536proof(rule CP)
6537  AOT_assume 1: x =E y
6538  AOT_hence 2: x = y by (metis "=E-simple:2" "vdash-properties:10") 
6539  AOT_have O!x using 1 by (meson "&E"(1) "=E-simple:1" "≡E"(1))
6540  AOT_hence x =E x using "ord=Eequiv:1" "→E" by blast
6541  AOT_thus y =E x using "rule=E"[rotated, OF 2] by fast
6542qed
6543
6544AOT_theorem "ord=Eequiv:3": (x =E y & y =E z)  x =E z
6545proof (rule CP)
6546  AOT_assume 1: x =E y & y =E z
6547  AOT_hence x = y & y = z
6548    by (metis "&I" "&E"(1) "&E"(2) "=E-simple:2" "vdash-properties:6")
6549  AOT_hence x = z by (metis "id-eq:3" "vdash-properties:6")
6550  moreover AOT_have x =E x
6551    using 1[THEN "&E"(1)] "&E"(1) "=E-simple:1" "≡E"(1) "ord=Eequiv:1" "→E" by blast
6552  ultimately AOT_show x =E z
6553    using "rule=E" by fast
6554qed
6555
6556AOT_theorem "ord-=E=:1": (O!x  O!y)  (x = y  x =E y)
6557proof(rule CP)
6558  AOT_assume O!x  O!y
6559  moreover {
6560    AOT_assume O!x
6561    AOT_hence O!x by (metis "oa-facts:1" "vdash-properties:10")
6562    moreover {
6563      AOT_modally_strict {
6564        AOT_have O!x  (x = y  x =E y)
6565        proof (rule "→I"; rule "≡I"; rule "→I")
6566          AOT_assume O!x
6567          AOT_hence x =E x by (metis "ord=Eequiv:1" "→E")
6568          moreover AOT_assume x = y
6569          ultimately AOT_show x =E y using "rule=E" by fast
6570        next
6571          AOT_assume x =E y
6572          AOT_thus x = y by (metis "=E-simple:2" "→E")
6573        qed
6574      }
6575      AOT_hence O!x  (x = y  x =E y) by (metis "RM:1")
6576    }
6577    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6578  }
6579  moreover {
6580    AOT_assume O!y
6581    AOT_hence O!y by (metis "oa-facts:1" "vdash-properties:10")
6582    moreover {
6583      AOT_modally_strict {
6584        AOT_have O!y  (x = y  x =E y)
6585        proof (rule "→I"; rule "≡I"; rule "→I")
6586          AOT_assume O!y
6587          AOT_hence y =E y by (metis "ord=Eequiv:1" "→E")
6588          moreover AOT_assume x = y
6589          ultimately AOT_show x =E y using "rule=E" id_sym by fast
6590        next
6591          AOT_assume x =E y
6592          AOT_thus x = y by (metis "=E-simple:2" "→E")
6593        qed
6594      }
6595      AOT_hence O!y  (x = y  x =E y) by (metis "RM:1")
6596    }
6597    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6598  }
6599  ultimately AOT_show (x = y  x =E y) by (metis "∨E"(3) "raa-cor:1")
6600qed
6601
6602AOT_theorem "ord-=E=:2": O!y  x x = y]
6603proof (rule "→I"; rule "safe-ext"[axiom_inst, THEN "→E"]; rule "&I")
6604  AOT_show x x =E y] by "cqt:2[lambda]"
6605next
6606  AOT_assume O!y
6607  AOT_hence 1: (x = y  x =E y) for x using "ord-=E=:1" "→E" "∨I" by blast
6608  AOT_have (x =E y  x = y) for x
6609    by (AOT_subst x =E y  x = y x = y  x =E y)
6610       (auto simp add: "Commutativity of ≡" 1)
6611  AOT_hence x (x =E y  x = y) by (rule GEN)
6612  AOT_thus x (x =E y  x = y) by (rule BF[THEN "→E"])
6613qed
6614
6615
6616AOT_theorem "ord-=E=:3": xy O!x & O!y & x = y]
6617proof (rule "safe-ext[2]"[axiom_inst, THEN "→E"]; rule "&I")
6618  AOT_show xy O!x & O!y & x =E y] by "cqt:2[lambda]"
6619next
6620  AOT_show xy ([O!]x & [O!]y & x =E y  [O!]x & [O!]y & x = y)
6621  proof (rule RN; rule GEN; rule GEN; rule "≡I"; rule "→I")
6622    AOT_modally_strict {
6623      AOT_show [O!]x & [O!]y & x = y if [O!]x & [O!]y & x =E y for x y
6624        by (metis "&I" "&E"(1) "Conjunction Simplification"(2) "=E-simple:2"
6625                  "modus-tollens:1" "raa-cor:1" that)
6626    }
6627  next
6628    AOT_modally_strict {
6629      AOT_show [O!]x & [O!]y & x =E y if [O!]x & [O!]y & x = y for x y
6630        apply(safe intro!: "&I")
6631          apply (metis that[THEN "&E"(1), THEN "&E"(1)])
6632         apply (metis that[THEN "&E"(1), THEN "&E"(2)])
6633        using "rule=E"[rotated, OF that[THEN "&E"(2)]]
6634              "ord=Eequiv:1"[THEN "→E", OF that[THEN "&E"(1), THEN "&E"(1)]] by fast
6635    }
6636  qed
6637qed
6638
6639AOT_theorem "ind-nec": F ([F]x  [F]y)  F ([F]x  [F]y)
6640proof(rule "→I")
6641  AOT_assume F ([F]x  [F]y)
6642  moreover AOT_have x F ([F]x  [F]y)] by "cqt:2[lambda]"
6643  ultimately AOT_have x F ([F]x  [F]y)]x  x F ([F]x  [F]y)]y
6644    using "∀E" by blast
6645  moreover AOT_have x F ([F]x  [F]y)]y
6646    apply (rule "β←C"(1))
6647      apply "cqt:2[lambda]"
6648     apply (fact "cqt:2[const_var]"[axiom_inst])
6649    by (simp add: RN GEN "oth-class-taut:3:a")
6650  ultimately AOT_have x F ([F]x  [F]y)]x using "≡E" by blast
6651  AOT_thus F ([F]x  [F]y)
6652    using "β→C"(1) by blast
6653qed
6654
6655AOT_theorem "ord=E:1": (O!x & O!y)  (F ([F]x  [F]y)  x =E y)
6656proof (rule "→I"; rule "→I")
6657  AOT_assume F ([F]x  [F]y)
6658  AOT_hence F ([F]x  [F]y)
6659    using "ind-nec"[THEN "→E"] by blast
6660  moreover AOT_assume O!x & O!y
6661  ultimately AOT_have O!x & O!y & F ([F]x  [F]y)
6662    using "&I" by blast
6663  AOT_thus x =E y using "=E-simple:1"[THEN "≡E"(2)] by blast
6664qed
6665
6666AOT_theorem "ord=E:2": (O!x & O!y)  (F ([F]x  [F]y)  x = y)
6667proof (rule "→I"; rule "→I")
6668  AOT_assume O!x & O!y
6669  moreover AOT_assume F ([F]x  [F]y)
6670  ultimately AOT_have x =E y
6671    using "ord=E:1" "→E" by blast
6672  AOT_thus x = y using "=E-simple:2"[THEN "→E"] by blast
6673qed
6674
6675AOT_theorem "ord=E2:1": (O!x & O!y)  (x  y  z z =E x]  z z =E y])
6676proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6677  AOT_assume 0: O!x & O!y
6678  AOT_assume x  y
6679  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6680  AOT_assume z z =E x] = z z =E y]
6681  moreover AOT_have z z =E x]x
6682    apply (rule "β←C"(1))
6683      apply "cqt:2[lambda]"
6684     apply (fact "cqt:2[const_var]"[axiom_inst])
6685    using "ord=Eequiv:1"[THEN "→E", OF 0[THEN "&E"(1)]].
6686  ultimately AOT_have z z =E y]x using "rule=E" by fast
6687  AOT_hence x =E y using "β→C"(1) by blast
6688  AOT_hence x = y by (metis "=E-simple:2" "vdash-properties:6")
6689  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6690next
6691  AOT_assume z z =E x]  z z =E y]
6692  AOT_hence 0: ¬(z z =E x] = z z =E y]) using "≡dfE"[OF "=-infix"] by blast
6693  AOT_have z z =E x] by "cqt:2[lambda]"
6694  AOT_hence z z =E x] = z z =E x]
6695    by (metis "rule=I:1")
6696  moreover AOT_assume x = y
6697  ultimately AOT_have z z =E x] = z z =E y]
6698    using "rule=E" by fast
6699  AOT_thus z z =E x] = z z =E y] & ¬(z z =E x] = z z =E y])
6700    using 0 "&I" by blast
6701qed
6702
6703AOT_theorem "ord=E2:2": (O!x & O!y)  (x  y  z z = x]  z z = y])
6704proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6705  AOT_assume 0: O!x & O!y
6706  AOT_assume x  y
6707  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6708  AOT_assume z z = x] = z z = y]
6709  moreover AOT_have z z = x]x
6710    apply (rule "β←C"(1))
6711    apply (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6712     apply (fact "cqt:2[const_var]"[axiom_inst])
6713    by (simp add: "id-eq:1")
6714  ultimately AOT_have z z = y]x using "rule=E" by fast
6715  AOT_hence x = y using "β→C"(1) by blast
6716  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6717next
6718  AOT_assume 0: O!x & O!y
6719  AOT_assume z z = x]  z z = y]
6720  AOT_hence 1: ¬(z z = x] = z z = y]) using "≡dfE"[OF "=-infix"] by blast
6721  AOT_have z z = x] by (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6722  AOT_hence z z = x] = z z = x]
6723    by (metis "rule=I:1")
6724  moreover AOT_assume x = y
6725  ultimately AOT_have z z = x] = z z = y]
6726    using "rule=E" by fast
6727  AOT_thus z z = x] = z z = y] & ¬(z z = x] = z z = y])
6728    using 1 "&I" by blast
6729qed
6730
6731AOT_theorem ordnecfail: O!x  ¬F x[F]
6732  by (meson "RM:1" "deduction-theorem" nocoder "oa-facts:1" "vdash-properties:10" "vdash-properties:1[2]")
6733
6734AOT_theorem "ab-obey:1": (A!x & A!y)  (F (x[F]  y[F])  x = y)
6735proof (rule "→I"; rule "→I")
6736  AOT_assume 1: A!x & A!y
6737  AOT_assume F (x[F]  y[F])
6738  AOT_hence x[F]  y[F] for F using "∀E" by blast
6739  AOT_hence (x[F]  y[F]) for F by (metis "en-eq:6[1]" "≡E"(1))
6740  AOT_hence F (x[F]  y[F]) by (rule GEN)
6741  AOT_hence F (x[F]  y[F]) by (rule BF[THEN "→E"])
6742  AOT_thus x = y
6743    using "≡dfI"[OF "identity:1", OF "∨I"(2)] 1 "&I" by blast
6744qed
6745
6746AOT_theorem "ab-obey:2": (F (x[F] & ¬y[F])  F (y[F] & ¬x[F]))  x  y
6747proof (rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6748  AOT_assume 1: x = y
6749  AOT_assume F (x[F] & ¬y[F])  F (y[F] & ¬x[F])
6750  moreover {
6751    AOT_assume F (x[F] & ¬y[F])
6752    then AOT_obtain F where x[F] & ¬y[F] using "∃E"[rotated] by blast
6753    moreover AOT_have y[F] using calculation[THEN "&E"(1)] 1 "rule=E" by fast
6754    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(2) "modus-tollens:2" "raa-cor:3")
6755  }
6756  moreover {
6757    AOT_assume F (y[F] & ¬x[F])
6758    then AOT_obtain F where y[F] & ¬x[F] using "∃E"[rotated] by blast
6759    moreover AOT_have ¬y[F] using calculation[THEN "&E"(2)] 1 "rule=E" by fast
6760    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(1) "modus-tollens:1" "raa-cor:3")
6761  }
6762  ultimately AOT_show p & ¬p for p by (metis "∨E"(3) "raa-cor:1")
6763qed
6764
6765AOT_theorem "encoders-are-abstract": F x[F]  A!x
6766  by (meson "deduction-theorem" "≡E"(2) "modus-tollens:2" nocoder
6767            "oa-contingent:3" "vdash-properties:1[2]")
6768
6769AOT_theorem "denote=:1": Hx x[H]
6770  by (rule GEN; rule "existence:2[1]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6771
6772AOT_theorem "denote=:2": Gx1...∃xn x1...xn[H]
6773  by (rule GEN; rule "existence:2"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6774
6775AOT_theorem "denote=:2[2]": Gx1x2 x1x2[H]
6776  by (rule GEN; rule "existence:2[2]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6777
6778AOT_theorem "denote=:2[3]": Gx1x2x3 x1x2x3[H]
6779  by (rule GEN; rule "existence:2[3]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6780
6781AOT_theorem "denote=:2[4]": Gx1x2x3x4 x1x2x3x4[H]
6782  by (rule GEN; rule "existence:2[4]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6783
6784AOT_theorem "denote=:3": x x[Π]  H (H = Π)
6785  using "existence:2[1]" "free-thms:1" "≡E"(2) "≡E"(5) "Commutativity of ≡" "≡Df" by blast
6786
6787AOT_theorem "denote=:4": (x1...∃xn x1...xn[Π])  H (H = Π)
6788  using "existence:2" "free-thms:1" "≡E"(6) "≡Df" by blast
6789
6790AOT_theorem "denote=:4[2]": (x1x2 x1x2[Π])  H (H = Π)
6791  using "existence:2[2]" "free-thms:1" "≡E"(6) "≡Df" by blast
6792
6793AOT_theorem "denote=:4[3]": (x1x2x3 x1x2x3[Π])  H (H = Π)
6794  using "existence:2[3]" "free-thms:1" "≡E"(6) "≡Df" by blast
6795
6796AOT_theorem "denote=:4[4]": (x1x2x3x4 x1x2x3x4[Π])  H (H = Π)
6797  using "existence:2[4]" "free-thms:1" "≡E"(6) "≡Df" by blast
6798
6799AOT_theorem "A-objects!": ∃!x (A!x & F (x[F]  φ{F}))
6800proof (rule "uniqueness:1"[THEN "≡dfI"])
6801  AOT_obtain a where a_prop: A!a & F (a[F]  φ{F})
6802    using "A-objects"[axiom_inst] "∃E"[rotated] by blast
6803  AOT_have (A!β & F (β[F]  φ{F}))  β = a for β
6804  proof (rule "→I")
6805    AOT_assume β_prop: [A!]β & F (β[F]  φ{F})
6806    AOT_hence β[F]  φ{F} for F using "∀E" "&E" by blast
6807    AOT_hence β[F]  a[F] for F
6808      using a_prop[THEN "&E"(2)] "∀E" "≡E"(2) "≡E"(5) "Commutativity of ≡" by fast
6809    AOT_hence F (β[F]  a[F]) by (rule GEN)
6810    AOT_thus β = a
6811      using "ab-obey:1"[THEN "→E", OF "&I"[OF β_prop[THEN "&E"(1)], OF a_prop[THEN "&E"(1)]], THEN "→E"] by blast
6812  qed
6813  AOT_hence β ((A!β & F (β[F]  φ{F}))  β = a) by (rule GEN)
6814  AOT_thus α ([A!]α & F (α[F]  φ{F}) & β ([A!]β & F (β[F]  φ{F})  β = α))
6815    using "∃I" using a_prop "&I" by fast
6816qed
6817
6818AOT_theorem "obj-oth:1": ∃!x (A!x & F (x[F]  [F]y))
6819  using "A-objects!" by fast
6820
6821AOT_theorem "obj-oth:2": ∃!x (A!x & F (x[F]  [F]y & [F]z))
6822  using "A-objects!" by fast
6823
6824AOT_theorem "obj-oth:3": ∃!x (A!x & F (x[F]  [F]y  [F]z))
6825  using "A-objects!" by fast
6826
6827AOT_theorem "obj-oth:4": ∃!x (A!x & F (x[F]  [F]y))
6828  using "A-objects!" by fast
6829
6830AOT_theorem "obj-oth:5": ∃!x (A!x & F (x[F]  F = G))
6831  using "A-objects!" by fast
6832
6833AOT_theorem "obj-oth:6": ∃!x (A!x & F (x[F]  y([G]y  [F]y)))
6834  using "A-objects!" by fast
6835
6836AOT_theorem "A-descriptions": ιx (A!x & F (x[F]  φ{F}))
6837  by (rule "A-Exists:2"[THEN "≡E"(2)]; rule "RA[2]"; rule "A-objects!")
6838
6839AOT_act_theorem "thm-can-terms2": y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6840  using "y-in:2" by blast
6841
6842AOT_theorem "can-ab2": y = ιx(A!x & F (x[F]  φ{F}))   A!y
6843proof(rule "→I")
6844  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6845  AOT_hence 𝒜(A!y & F (y[F]  φ{F}))
6846    using "actual-desc:2"[THEN "→E"] by blast
6847  AOT_hence 𝒜A!y by (metis "Act-Basic:2" "&E"(1) "≡E"(1))
6848  AOT_thus A!y by (metis "≡E"(2) "oa-facts:8")
6849qed
6850
6851AOT_act_theorem "desc-encode:1": ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6852proof -
6853  AOT_have ιx(A!x & F (x[F]  φ{F}))
6854    by (simp add: "A-descriptions")
6855  AOT_hence A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6856    using "y-in:3"[THEN "→E"] by blast
6857  AOT_thus ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6858    using "&E" "∀E" by blast
6859qed
6860
6861AOT_act_theorem "desc-encode:2": ιx(A!x & F (x[F]  φ{F}))[G]  φ{G}
6862  using "desc-encode:1".
6863
6864AOT_theorem "desc-nec-encode:1": ιx (A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6865proof -
6866  AOT_have 0: ιx(A!x & F (x[F]  φ{F}))
6867    by (simp add: "A-descriptions")
6868  AOT_hence 𝒜(A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}))
6869    using "actual-desc:4"[THEN "→E"] by blast
6870  AOT_hence 𝒜F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6871    using "Act-Basic:2" "&E"(2) "≡E"(1) by blast
6872  AOT_hence F 𝒜(ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6873    using "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]" by blast
6874  AOT_hence 𝒜(ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6875    using "∀E" by blast
6876  AOT_hence 𝒜ιx(A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6877    using "Act-Basic:5" "≡E"(1) by blast
6878  AOT_thus ιx(A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6879    using "en-eq:10[1]"[unvarify x1, OF 0] "≡E"(6) by blast
6880qed
6881
6882AOT_theorem "desc-nec-encode:2": ιx (A!x & F (x[F]  φ{F}))[G]  𝒜φ{G}
6883  using "desc-nec-encode:1".
6884
6885AOT_theorem "Box-desc-encode:1": φ{G}  ιx(A!x & F (x[F]  φ{G}))[G]
6886  by (rule "→I"; rule "desc-nec-encode:2"[THEN "≡E"(2)])
6887     (meson "nec-imp-act" "vdash-properties:10")
6888
6889AOT_theorem "Box-desc-encode:2": φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6890proof(rule CP)
6891  AOT_assume φ{G}
6892  AOT_hence φ{G} by (metis "S5Basic:6" "≡E"(1))
6893  moreover AOT_have φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6894  proof (rule RM; rule "→I")
6895    AOT_modally_strict {
6896      AOT_assume 1: φ{G}
6897      AOT_hence ιx(A!x & F (x[F]  φ{G}))[G] using "Box-desc-encode:1" "→E" by blast
6898      moreover AOT_have φ{G} using 1 by (meson "qml:2" "vdash-properties:10" "vdash-properties:1[2]")
6899      ultimately AOT_show ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}
6900        using "deduction-theorem" "≡I" by simp
6901    }
6902  qed
6903  ultimately AOT_show (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}) using "→E" by blast
6904qed
6905
6906definition rigid_condition where rigid_condition φ  v . [v  α (φ{α}  φ{α})]
6907syntax rigid_condition :: ‹id_position  AOT_prop› ("RIGID'_CONDITION'(_')")
6908
6909AOT_theorem "strict-can:1[E]": assumes RIGID_CONDITION(φ)
6910  shows α (φ{α}  φ{α})
6911  using assms[unfolded rigid_condition_def] by auto
6912
6913AOT_theorem "strict-can:1[I]":
6914  assumes  α (φ{α}  φ{α})
6915  shows RIGID_CONDITION(φ)
6916  using assms rigid_condition_def by auto
6917
6918AOT_theorem "box-phi-a:1": assumes RIGID_CONDITION(φ)
6919  shows (A!x  & F (x[F]  φ{F}))  (A!x & F (x[F]  φ{F}))
6920proof (rule "→I")
6921  AOT_assume a: A!x & F (x[F]  φ{F})
6922  AOT_hence b: A!x by (metis "Conjunction Simplification"(1) "oa-facts:2" "vdash-properties:10")
6923  AOT_have x[F]  φ{F} for F using a[THEN "&E"(2)] "∀E" by blast
6924  moreover AOT_have (x[F]  x[F]) for F by (meson "pre-en-eq:1[1]" RN)
6925  moreover AOT_have (φ{F}  φ{F}) for F using RN "strict-can:1[E]"[OF assms] "∀E" by blast
6926  ultimately AOT_have (x[F]  φ{F}) for F
6927    using "sc-eq-box-box:5" "qml:2"[axiom_inst, THEN "→E"] "→E" "&I" by metis
6928  AOT_hence F (x[F]  φ{F}) by (rule GEN)
6929  AOT_hence F (x[F]  φ{F}) by (rule BF[THEN "→E"])
6930  AOT_thus ([A!]x & F (x[F]  φ{F}))
6931    using b "KBasic:3" "≡S"(1) "≡E"(2) by blast
6932qed
6933
6934AOT_theorem "box-phi-a:2": assumes RIGID_CONDITION(φ)
6935  shows y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6936proof(rule "→I")
6937  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6938  AOT_hence 𝒜(A!y & F (y[F]  φ{F})) using "actual-desc:2"[THEN "→E"] by fast
6939  AOT_hence abs: 𝒜A!y and 𝒜F (y[F]  φ{F})
6940    using "Act-Basic:2" "&E" "≡E"(1) by blast+
6941  AOT_hence F 𝒜(y[F]  φ{F}) by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
6942  AOT_hence 𝒜(y[F]  φ{F}) for F using "∀E" by blast
6943  AOT_hence 𝒜y[F]  𝒜φ{F} for F by (metis "Act-Basic:5" "≡E"(1)) 
6944  AOT_hence y[F]  φ{F} for F
6945    using "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=F], THEN RN]]
6946    by (metis "en-eq:10[1]" "≡E"(6))
6947  AOT_hence F (y[F]  φ{F}) by (rule GEN)
6948  AOT_thus [A!]y & F (y[F]  φ{F}) using abs "&I" "≡E"(2) "oa-facts:8" by blast
6949qed
6950
6951AOT_theorem "box-phi-a:3": assumes RIGID_CONDITION(φ)
6952  shows ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6953  using "desc-nec-encode:2"
6954    "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=F], THEN RN]]
6955    "≡E"(5) by blast
6956
6957AOT_define Null :: ‹τ  φ› ("Null'(_')") 
6958  "df-null-uni:1": Null(x) df A!x & ¬F x[F]
6959
6960AOT_define Universal :: ‹τ  φ› ("Universal'(_')")
6961  "df-null-uni:2": Universal(x) df A!x & F x[F]
6962
6963AOT_theorem "null-uni-uniq:1": ∃!x Null(x)
6964proof (rule "uniqueness:1"[THEN "≡dfI"])
6965  AOT_obtain a where a_prop: A!a & F (a[F]  ¬(F = F))
6966    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
6967  AOT_have a_null: ¬a[F] for F
6968  proof (rule "raa-cor:2")
6969    AOT_assume a[F]
6970    AOT_hence ¬(F = F) using a_prop[THEN "&E"(2)] "∀E" "≡E" by blast
6971    AOT_hence F = F & ¬(F = F) by (metis "id-eq:1" "raa-cor:3")
6972    AOT_thus p & ¬p for p  by (metis "raa-cor:1")
6973  qed
6974  AOT_have Null(a) & β (Null(β)  β = a)
6975  proof (rule "&I")
6976    AOT_have ¬F a[F] using a_null by (metis "instantiation" "reductio-aa:1")
6977    AOT_thus Null(a)
6978      using "df-null-uni:1"[THEN "≡dfI"] a_prop[THEN "&E"(1)] "&I" by metis
6979  next
6980    AOT_show β (Null(β)  β = a)
6981    proof (rule GEN; rule "→I")
6982      fix β
6983      AOT_assume a: Null(β)
6984      AOT_hence ¬F β[F]
6985        using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6986      AOT_hence β_null: ¬β[F] for F by (metis "existential:2[const_var]" "reductio-aa:1")
6987      AOT_have F (β[F]  a[F])
6988        apply (rule GEN; rule "≡I"; rule CP)
6989        using "raa-cor:3" β_null a_null by blast+
6990      moreover AOT_have A!β using a "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6991      ultimately AOT_show β = a
6992        using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" by blast
6993    qed
6994  qed
6995  AOT_thus α (Null(α) & β (Null(β)  β = α)) using "∃I"(2) by fast
6996qed
6997
6998AOT_theorem "null-uni-uniq:2": ∃!x Universal(x)
6999proof (rule "uniqueness:1"[THEN "≡dfI"])
7000  AOT_obtain a where a_prop: A!a & F (a[F]  F = F)
7001    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7002  AOT_hence aF: a[F] for F using "&E" "∀E" "≡E" "id-eq:1" by fast
7003  AOT_hence Universal(a)
7004    using "df-null-uni:2"[THEN "≡dfI"] "&I" a_prop[THEN "&E"(1)] GEN by blast
7005  moreover AOT_have β (Universal(β)  β = a)
7006  proof (rule GEN; rule "→I")
7007    fix β
7008    AOT_assume Universal(β)
7009    AOT_hence abs_β: A!β and β[F] for F using "df-null-uni:2"[THEN "≡dfE"] "&E" "∀E" by blast+
7010    AOT_hence β[F]  a[F] for F using aF by (metis "deduction-theorem" "≡I")
7011    AOT_hence F (β[F]  a[F]) by (rule GEN)
7012    AOT_thus β = a
7013      using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" abs_β by blast
7014  qed
7015  ultimately AOT_show α (Universal(α) & β (Universal(β)  β = α))
7016    using "&I" "∃I" by fast
7017qed
7018
7019AOT_theorem "null-uni-uniq:3": ιx Null(x)
7020  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:1" by blast
7021
7022AOT_theorem "null-uni-uniq:4": ιx Universal(x)
7023  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:2" by blast
7024
7025AOT_define Null_object :: ‹κs (a)
7026  "df-null-uni-terms:1": a =df ιx Null(x)
7027
7028AOT_define Universal_object :: ‹κs (aV)
7029  "df-null-uni-terms:2": aV =df ιx Universal(x)
7030
7031AOT_theorem "null-uni-facts:1": Null(x)  Null(x)
7032proof (rule "→I")
7033  AOT_assume Null(x)
7034  AOT_hence x_abs: A!x and x_null: ¬F x[F]
7035    using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast+
7036  AOT_have ¬x[F] for F using x_null
7037    using "existential:2[const_var]" "reductio-aa:1"
7038    by metis
7039  AOT_hence ¬x[F] for F by (metis "en-eq:7[1]" "≡E"(1))
7040  AOT_hence F ¬x[F] by (rule GEN)
7041  AOT_hence F ¬x[F] by (rule BF[THEN "→E"])
7042  moreover AOT_have F ¬x[F]  ¬F x[F]
7043    apply (rule RM)
7044    by (metis (full_types) "instantiation" "cqt:2[const_var]" "deduction-theorem"
7045                           "reductio-aa:1" "rule-ui:1" "vdash-properties:1[2]")
7046  ultimately AOT_have ¬F x[F]
7047    by (metis "→E")
7048  moreover AOT_have A!x using x_abs
7049    using "oa-facts:2" "vdash-properties:10" by blast
7050  ultimately AOT_have r: (A!x & ¬F x[F])
7051    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
7052  AOT_show Null(x)
7053    by (AOT_subst Null(x) A!x & ¬F x[F])
7054       (auto simp: "df-null-uni:1" "≡Df" r)
7055qed  
7056
7057AOT_theorem "null-uni-facts:2": Universal(x)  Universal(x)
7058proof (rule "→I")
7059  AOT_assume Universal(x)
7060  AOT_hence x_abs: A!x and x_univ: F x[F]
7061    using "df-null-uni:2"[THEN "≡dfE"] "&E" by blast+
7062  AOT_have x[F] for F using x_univ "∀E" by blast
7063  AOT_hence x[F] for F by (metis "en-eq:2[1]" "≡E"(1))
7064  AOT_hence F x[F] by (rule GEN)
7065  AOT_hence F x[F] by (rule BF[THEN "→E"])
7066  moreover AOT_have A!x using x_abs
7067    using "oa-facts:2" "vdash-properties:10" by blast
7068  ultimately AOT_have r: (A!x & F x[F])
7069    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
7070  AOT_show Universal(x)
7071    by (AOT_subst Universal(x) A!x & F x[F])
7072       (auto simp add: "df-null-uni:2" "≡Df" r)
7073qed
7074
7075AOT_theorem "null-uni-facts:3": Null(a)
7076  apply (rule "=dfI"(2)[OF "df-null-uni-terms:1"])
7077   apply (simp add: "null-uni-uniq:3")
7078  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:3"]
7079    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:1"[unvarify x, THEN RN, OF "null-uni-uniq:3"], THEN "≡E"(1)]
7080  by blast
7081
7082AOT_theorem "null-uni-facts:4": Universal(aV)
7083  apply (rule "=dfI"(2)[OF "df-null-uni-terms:2"])
7084   apply (simp add: "null-uni-uniq:4")
7085  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:4"]
7086    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:2"[unvarify x, THEN RN, OF "null-uni-uniq:4"], THEN "≡E"(1)]
7087  by blast
7088
7089AOT_theorem "null-uni-facts:5": a  aV
7090proof (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"];
7091    rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"];
7092    rule "≡dfI"[OF "=-infix"];
7093    rule "raa-cor:2")
7094  AOT_obtain x where nullx: Null(x)
7095    by (metis "instantiation" "df-null-uni-terms:1" "existential:1" "null-uni-facts:3"
7096              "null-uni-uniq:3" "rule-id-df:2:b[zero]")
7097  AOT_hence act_null: 𝒜Null(x) by (metis "nec-imp-act" "null-uni-facts:1" "vdash-properties:10")
7098  AOT_assume ιx Null(x) = ιx Universal(x)
7099  AOT_hence 𝒜x(Null(x)  Universal(x))
7100    using "actual-desc:5"[THEN "→E"] by blast
7101  AOT_hence x 𝒜(Null(x)  Universal(x))
7102    by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
7103  AOT_hence 𝒜Null(x)  𝒜Universal(x)
7104    using "Act-Basic:5" "≡E"(1) "rule-ui:3" by blast
7105  AOT_hence 𝒜Universal(x) using act_null "≡E" by blast
7106  AOT_hence Universal(x) by (metis RN "≡E"(1) "null-uni-facts:2" "sc-eq-fur:2" "vdash-properties:10")
7107  AOT_hence F x[F] using "≡dfE"[OF "df-null-uni:2"] "&E" by metis
7108  moreover AOT_have ¬F x[F] using nullx "≡dfE"[OF "df-null-uni:1"] "&E" by metis
7109  ultimately AOT_show p & ¬p for p by (metis "cqt-further:1" "raa-cor:3" "vdash-properties:10")
7110qed
7111
7112AOT_theorem "null-uni-facts:6": a = ιx(A!x & F (x[F]  F  F))
7113proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7114  AOT_show ιx([A!]x & F (x[F]  F  F))
7115    by (simp add: "A-descriptions")
7116next
7117  AOT_show a
7118    by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7119       (simp add: "null-uni-uniq:3")
7120next
7121  AOT_have ιx([A!]x & F (x[F]  F  F))
7122    by (simp add: "A-descriptions")
7123  AOT_hence 1: ιx([A!]x & F (x[F]  F  F)) = ιx([A!]x & F (x[F]  F  F))
7124    using "rule=I:1" by blast
7125  AOT_show [A!]a & [A!]ιx([A!]x & F (x[F]  F  F))
7126    apply (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"]; rule "&I")
7127    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:1" "df-null-uni-terms:1" "null-uni-facts:3" "null-uni-uniq:3" "rule-id-df:2:a[zero]" "vdash-properties:10")
7128    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7129next
7130  AOT_show F (a[F]  ιx([A!]x & F (x[F]  F  F))[F])
7131  proof (rule GEN)
7132    fix F
7133    AOT_have ¬a[F]
7134      by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7135         (metis (no_types, lifting) "≡dfE" "&E"(2) "∨I"(2) "∨E"(3)
7136                "df-null-uni:1" "df-null-uni-terms:1" "existential:2[const_var]" "null-uni-facts:3"
7137                "raa-cor:2" "rule-id-df:2:a[zero]" "russell-axiom[enc,1].ψ_denotes_asm")
7138    moreover AOT_have ¬ιx([A!]x & F (x[F]  F  F))[F]
7139    proof(rule "raa-cor:2")
7140      AOT_assume 0: ιx([A!]x & F (x[F]  F  F))[F]
7141      AOT_hence 𝒜(F  F) using "desc-nec-encode:2"[THEN "≡E"(1), OF 0] by blast
7142      moreover AOT_have ¬𝒜(F  F)
7143        using "≡dfE" "id-act:2" "id-eq:1" "≡E"(2) "=-infix" "raa-cor:3" by blast
7144      ultimately AOT_show 𝒜(F  F) & ¬𝒜(F  F) by (rule "&I")
7145    qed
7146    ultimately AOT_show a[F]  ιx([A!]x & F (x[F]  F  F))[F]
7147      using "deduction-theorem" "≡I" "raa-cor:4" by blast
7148  qed
7149qed
7150
7151AOT_theorem "null-uni-facts:7": aV = ιx(A!x & F (x[F]  F = F))
7152proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7153  AOT_show ιx([A!]x & F (x[F]  F = F))
7154    by (simp add: "A-descriptions")
7155next
7156  AOT_show aV
7157    by (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7158       (simp add: "null-uni-uniq:4")
7159next
7160  AOT_have ιx([A!]x & F (x[F]  F = F))
7161    by (simp add: "A-descriptions")
7162  AOT_hence 1: ιx([A!]x & F (x[F]  F = F)) = ιx([A!]x & F (x[F]  F = F))
7163    using "rule=I:1" by blast
7164  AOT_show [A!]aV & [A!]ιx([A!]x & F (x[F]  F = F))
7165    apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"]; rule "&I")
7166    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-df:2:a[zero]" "vdash-properties:10")
7167    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7168next
7169  AOT_show F (aV[F]  ιx([A!]x & F (x[F]  F = F))[F])
7170  proof (rule GEN)
7171    fix F
7172    AOT_have aV[F]
7173      apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7174      using "≡dfE" "&E"(2) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-df:2:a[zero]" "rule-ui:3" by blast
7175    moreover AOT_have ιx([A!]x & F (x[F]  F = F))[F]
7176      using "RA[2]" "desc-nec-encode:2" "id-eq:1" "≡E"(2) by fastforce
7177    ultimately AOT_show aV[F]  ιx([A!]x & F (x[F]  F = F))[F]
7178      using "deduction-theorem" "≡I" by simp
7179  qed
7180qed
7181
7182AOT_theorem "aclassical:1": Rxy(A!x & A!y & x  y & z [R]zx] = z [R]zy])
7183proof(rule GEN)
7184  fix R
7185  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]zy] & ¬y[F]))
7186    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7187  AOT_have a_enc: az [R]za]
7188  proof (rule "raa-cor:1")
7189    AOT_assume 0: ¬az [R]za]
7190    AOT_hence ¬y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7191      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]za]»"],
7192                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7193         "cqt:2[lambda]"
7194    AOT_hence y ¬(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7195      using "cqt-further:4" "vdash-properties:10" by blast
7196    AOT_hence ¬(A!a & z [R]za] = z [R]za] & ¬az [R]za]) using "∀E" by blast
7197    AOT_hence (A!a & z [R]za] = z [R]za])  az [R]za]
7198      by (metis "&I" "deduction-theorem" "raa-cor:3")
7199    moreover AOT_have z [R]za] = z [R]za]
7200      by (rule "=I") "cqt:2[lambda]"
7201    ultimately AOT_have az [R]za] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7202    AOT_thus az [R]za] & ¬az [R]za]
7203      using 0 "&I" by blast
7204  qed
7205  AOT_hence y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7206    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7207  then AOT_obtain b where b_prop: A!b & z [R]za] = z [R]zb] & ¬bz [R]za]
7208    using "∃E"[rotated] by blast
7209  AOT_have a  b
7210    apply (rule "≡dfI"[OF "=-infix"])
7211    using a_enc b_prop[THEN "&E"(2)]
7212    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7213  AOT_hence A!a & A!b & a  b & z [R]za] = z [R]zb]
7214    using b_prop "&E" a_prop "&I" by meson
7215  AOT_hence y (A!a & A!y & a  y & z [R]za] = z [R]zy]) by (rule "∃I")
7216  AOT_thus xy (A!x & A!y & x  y & z [R]zx] = z [R]zy]) by (rule "∃I")
7217qed
7218
7219AOT_theorem "aclassical:2": Rxy(A!x & A!y & x  y & z [R]xz] = z [R]yz])
7220proof(rule GEN)
7221  fix R
7222  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]yz] & ¬y[F]))
7223    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7224  AOT_have a_enc: az [R]az]
7225  proof (rule "raa-cor:1")
7226    AOT_assume 0: ¬az [R]az]
7227    AOT_hence ¬y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7228      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]az]»"],
7229                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7230         "cqt:2[lambda]"
7231    AOT_hence y ¬(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7232      using "cqt-further:4" "vdash-properties:10" by blast
7233    AOT_hence ¬(A!a & z [R]az] = z [R]az] & ¬az [R]az]) using "∀E" by blast
7234    AOT_hence (A!a & z [R]az] = z [R]az])  az [R]az]
7235      by (metis "&I" "deduction-theorem" "raa-cor:3")
7236    moreover AOT_have z [R]az] = z [R]az]
7237      by (rule "=I") "cqt:2[lambda]"
7238    ultimately AOT_have az [R]az] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7239    AOT_thus az [R]az] & ¬az [R]az]
7240      using 0 "&I" by blast
7241  qed
7242  AOT_hence y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7243    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7244  then AOT_obtain b where b_prop: A!b & z [R]az] = z [R]bz] & ¬bz [R]az]
7245    using "∃E"[rotated] by blast
7246  AOT_have a  b
7247    apply (rule "≡dfI"[OF "=-infix"])
7248    using a_enc b_prop[THEN "&E"(2)]
7249    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7250  AOT_hence A!a & A!b & a  b & z [R]az] = z [R]bz]
7251    using b_prop "&E" a_prop "&I" by meson
7252  AOT_hence y (A!a & A!y & a  y & z [R]az] = z [R]yz]) by (rule "∃I")
7253  AOT_thus xy (A!x & A!y & x  y & z [R]xz] = z [R]yz]) by (rule "∃I")
7254qed
7255
7256AOT_theorem "aclassical:3": Fxy(A!x & A!y & x  y &  [F]x] =  [F]y])
7257proof(rule GEN)
7258  fix R
7259  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]y] & ¬y[F]))
7260    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7261  AOT_have z [R]a] by "cqt:2[lambda]"
7262  (* TODO: S should no longer be necessary *)
7263  then AOT_obtain S where S_def: S = z [R]a]
7264    by (metis "instantiation" "rule=I:1" "existential:1" id_sym)
7265  AOT_have a_enc: a[S]
7266  proof (rule "raa-cor:1")
7267    AOT_assume 0: ¬a[S]
7268    AOT_hence ¬y(A!y & S = z [R]y] & ¬y[S])
7269      by (rule a_prop[THEN "&E"(2), THEN "∀E"(2)[where β=S],
7270                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated]) 
7271    AOT_hence y ¬(A!y & S = z [R]y] & ¬y[S])
7272      using "cqt-further:4" "vdash-properties:10" by blast
7273    AOT_hence ¬(A!a & S = z [R]a] & ¬a[S]) using "∀E" by blast
7274    AOT_hence (A!a & S = z [R]a])  a[S]
7275      by (metis "&I" "deduction-theorem" "raa-cor:3")
7276    moreover AOT_have S = z [R]a] using S_def .
7277    ultimately AOT_have a[S] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7278    AOT_thus az [R]a] & ¬az [R]a]  by (metis "0" "raa-cor:3") 
7279  qed
7280  AOT_hence y(A!y & S = z [R]y] & ¬y[S])
7281    by (rule a_prop[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1), rotated])
7282  then AOT_obtain b where b_prop: A!b & S = z [R]b] & ¬b[S]
7283    using "∃E"[rotated] by blast
7284  AOT_have 1: a  b
7285    apply (rule "≡dfI"[OF "=-infix"])
7286    using a_enc b_prop[THEN "&E"(2)]
7287    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7288  AOT_have a:  [R]a] = ([R]a)
7289    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7290    by (meson "log-prop-prop:2")
7291  AOT_have b:  [R]b] = ([R]b)
7292    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7293    by (meson "log-prop-prop:2")
7294  AOT_have  [R]a] =  [R]b]
7295    apply (rule "rule=E"[rotated, OF a[THEN id_sym]])
7296    apply (rule "rule=E"[rotated, OF b[THEN id_sym]])
7297    apply (rule "identity:4"[THEN "≡dfI", OF "&I", rotated])
7298     apply (rule "rule=E"[rotated, OF S_def])
7299    using b_prop "&E" apply blast
7300    apply (safe intro!: "&I")
7301    by (simp add: "log-prop-prop:2")+
7302  AOT_hence A!a & A!b & a  b &  [R]a] =  [R]b]
7303    using 1 a_prop[THEN "&E"(1)] b_prop[THEN "&E"(1), THEN "&E"(1)] "&I" by auto
7304  AOT_hence y (A!a & A!y & a  y &  [R]a] =  [R]y]) by (rule "∃I")
7305  AOT_thus xy (A!x & A!y & x  y &  [R]x] =  [R]y]) by (rule "∃I")
7306qed
7307
7308AOT_theorem aclassical2: xy (A!x & A!y & x  y & F ([F]x  [F]y))
7309proof -
7310  AOT_have x y ([A!]x & [A!]y & x  y &
7311               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7312    by (rule "aclassical:1"[THEN "∀E"(1)[where τ="«xy F ([F]x  [F]y)]»"]])
7313       "cqt:2[lambda]"
7314  then AOT_obtain x where y ([A!]x & [A!]y & x  y &
7315               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7316    using "∃E"[rotated] by blast
7317  then AOT_obtain y where 0: ([A!]x & [A!]y & x  y &
7318               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7319    using "∃E"[rotated] by blast
7320  AOT_have z xy F ([F]x  [F]y)]zx]x
7321    apply (rule "β←C"(1))
7322      apply "cqt:2[lambda]"
7323     apply (fact "cqt:2[const_var]"[axiom_inst])
7324    apply (rule "β←C"(1))
7325      apply "cqt:2[lambda]"
7326    apply (simp add: "&I" "ex:1:a" prod_denotesI "rule-ui:3")
7327    by (simp add: "oth-class-taut:3:a" "universal-cor")
7328  AOT_hence z xy F ([F]x  [F]y)]zy]x
7329    by (rule "rule=E"[rotated, OF 0[THEN "&E"(2)]])
7330  AOT_hence xy F ([F]x  [F]y)]xy
7331    by (rule "β→C"(1))
7332  AOT_hence F ([F]x  [F]y)
7333    using "β→C"(1) old.prod.case by fast
7334  AOT_hence [A!]x & [A!]y & x  y & F ([F]x  [F]y) using 0 "&E" "&I" by blast
7335  AOT_hence y ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I")
7336  AOT_thus xy ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I"(2))
7337qed
7338
7339AOT_theorem "kirchner-thm:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7340proof(rule "≡I"; rule "→I")
7341  AOT_assume x φ{x}]
7342  AOT_hence x φ{x}] by (metis "exist-nec" "vdash-properties:10")
7343  moreover AOT_have x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7344  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7345    AOT_modally_strict {
7346      fix x y
7347      AOT_assume 0: x φ{x}]
7348      moreover AOT_assume F([F]x  [F]y)
7349      ultimately AOT_have x φ{x}]x  x φ{x}]y
7350        using "∀E" by blast
7351      AOT_thus (φ{x}  φ{y})
7352        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7353    }
7354  qed
7355  ultimately AOT_show xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7356    using "→E" by blast
7357next
7358  AOT_have xy(F([F]x  [F]y)  (φ{x}  φ{y}))  y(x(F([F]x  [F]y) & φ{x})  φ{y})
7359  proof(rule "RM:1"; rule "→I"; rule GEN)
7360    AOT_modally_strict {
7361      AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7362      AOT_hence indisc: φ{x}  φ{y} if F([F]x  [F]y) for x y
7363        using "∀E"(2) "→E" that by blast
7364      AOT_show (x(F([F]x  [F]y) & φ{x})  φ{y}) for y
7365      proof (rule "raa-cor:1")
7366        AOT_assume ¬(x(F([F]x  [F]y) & φ{x})  φ{y})
7367        AOT_hence (x(F([F]x  [F]y) & φ{x}) & ¬φ{y})  (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7368          using "≡E"(1) "oth-class-taut:4:h" by blast
7369        moreover {
7370          AOT_assume 0: x(F([F]x  [F]y) & φ{x}) & ¬φ{y}
7371          AOT_obtain a where F([F]a  [F]y) & φ{a}
7372            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7373          AOT_hence φ{y} using indisc[THEN "≡E"(1)] "&E" by blast
7374          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7375        }
7376        moreover {
7377          AOT_assume 0: (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7378          AOT_hence x ¬(F([F]x  [F]y) & φ{x})
7379            using "&E"(1) "cqt-further:4" "→E" by blast
7380          AOT_hence ¬(F([F]y  [F]y) & φ{y}) using "∀E" by blast
7381          AOT_hence ¬F([F]y  [F]y)  ¬φ{y}
7382            using "≡E"(1) "oth-class-taut:5:c" by blast
7383          moreover AOT_have F([F]y  [F]y) by (simp add: "oth-class-taut:3:a" "universal-cor")
7384          ultimately AOT_have ¬φ{y} by (metis "¬¬I" "∨E"(2))
7385          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7386        }
7387        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7388      qed
7389    }
7390  qed
7391  moreover AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7392  ultimately AOT_have y(x(F([F]x  [F]y) & φ{x})  φ{y})
7393    using "→E" by blast
7394  AOT_thus x φ{x}]
7395    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7396qed
7397
7398AOT_theorem "kirchner-thm:2": x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7399proof(rule "≡I"; rule "→I")
7400  AOT_assume x1...xn φ{x1...xn}]
7401  AOT_hence x1...xn φ{x1...xn}] by (metis "exist-nec" "vdash-properties:10")
7402  moreover AOT_have x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7403  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7404    AOT_modally_strict {
7405      fix x1xn y1yn :: 'a AOT_var›
7406      AOT_assume 0: x1...xn φ{x1...xn}]
7407      moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7408      ultimately AOT_have x1...xn φ{x1...xn}]x1...xn  x1...xn φ{x1...xn}]y1...yn
7409        using "∀E" by blast
7410      AOT_thus (φ{x1...xn}  φ{y1...yn})
7411        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7412    }
7413  qed
7414  ultimately AOT_show x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7415    using "→E" by blast
7416next
7417  AOT_have (x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))) 
7418            y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7419  proof(rule "RM:1"; rule "→I"; rule GEN)
7420    AOT_modally_strict {
7421      AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7422      AOT_hence indisc: φ{x1...xn}  φ{y1...yn} if F([F]x1...xn  [F]y1...yn) for x1xn y1yn
7423        using "∀E"(2) "→E" that by blast
7424      AOT_show (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn} for y1yn
7425      proof (rule "raa-cor:1")
7426        AOT_assume ¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7427        AOT_hence ((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}) 
7428                    (¬(x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & φ{y1...yn})
7429          using "≡E"(1) "oth-class-taut:4:h" by blast
7430        moreover {
7431          AOT_assume 0: (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}
7432          AOT_obtain a1an where F([F]a1...an  [F]y1...yn) & φ{a1...an}
7433            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7434          AOT_hence φ{y1...yn} using indisc[THEN "≡E"(1)] "&E" by blast
7435          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7436        }
7437        moreover {
7438          AOT_assume 0: (¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))) & φ{y1...yn})
7439          AOT_hence x1...∀xn ¬(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})
7440            using "&E"(1) "cqt-further:4" "→E" by blast
7441          AOT_hence ¬(F([F]y1...yn  [F]y1...yn) & φ{y1...yn}) using "∀E" by blast
7442          AOT_hence ¬F([F]y1...yn  [F]y1...yn)  ¬φ{y1...yn}
7443            using "≡E"(1) "oth-class-taut:5:c" by blast
7444          moreover AOT_have F([F]y1...yn  [F]y1...yn)
7445            by (simp add: "oth-class-taut:3:a" "universal-cor")
7446          ultimately AOT_have ¬φ{y1...yn} by (metis "¬¬I" "∨E"(2))
7447          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7448        }
7449        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7450      qed
7451    }
7452  qed
7453  moreover AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7454  ultimately AOT_have y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7455    using "→E" by blast
7456  AOT_thus x1...xn φ{x1...xn}]
7457    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7458qed
7459
7460AOT_theorem "kirchner-thm-cor:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7461proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7462  fix x y
7463  AOT_assume x φ{x}]
7464  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7465    by (rule "kirchner-thm:1"[THEN "≡E"(1)])
7466  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7467    using CBF[THEN "→E"] by blast
7468  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7469    using "∀E" by blast
7470  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7471    using CBF[THEN "→E"] by blast
7472  AOT_hence (F ([F]x  [F]y)  (φ{x}  φ{y}))
7473    using "∀E" by blast
7474  AOT_hence F ([F]x  [F]y)  (φ{x}  φ{y})
7475    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7476  moreover AOT_assume F([F]x  [F]y)
7477  ultimately AOT_show (φ{x}  φ{y}) using "→E" "ind-nec" by blast
7478qed
7479
7480AOT_theorem "kirchner-thm-cor:2":
7481  x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7482proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7483  fix x1xn y1yn
7484  AOT_assume x1...xn φ{x1...xn}]
7485  AOT_hence 0: x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7486    by (rule "kirchner-thm:2"[THEN "≡E"(1)])
7487  AOT_have x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7488  proof(rule GEN; rule GEN)
7489    fix x1xn y1yn
7490    AOT_show (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7491      apply (rule "RM:1"[THEN "→E", rotated, OF 0]; rule "→I")
7492      using "∀E" by blast
7493  qed
7494  AOT_hence y1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7495    using "∀E" by blast
7496  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7497    using "∀E" by blast
7498  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7499    using "∀E" by blast
7500  AOT_hence 0: F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn})
7501    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7502  moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7503  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)] by "cqt:2[lambda]"
7504  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn  x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7505    using "∀E" by blast
7506  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7507    apply (rule "β←C"(1))
7508      apply "cqt:2[lambda]"
7509     apply (fact "cqt:2[const_var]"[axiom_inst])
7510    by (simp add: RN GEN "oth-class-taut:3:a")
7511  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn using "≡E"(2) by blast
7512  AOT_hence F ([F]x1...xn  [F]y1...yn)
7513    using "β→C"(1) by blast
7514  AOT_thus (φ{x1...xn}  φ{y1...yn}) using "→E" 0 by blast
7515qed
7516
7517AOT_define propositional :: ‹Π  φ› (Propositional'(_'))
7518  "prop-prop1": Propositional([F]) df p(F = y p])
7519
7520AOT_theorem "prop-prop2:1": p y p]
7521  by (rule GEN) "cqt:2[lambda]"
7522
7523AOT_theorem "prop-prop2:2": ν φ]
7524  by "cqt:2[lambda]"
7525
7526AOT_theorem "prop-prop2:3": F = y p]  x([F]x  p)
7527proof (rule "→I")
7528  AOT_assume 0: F = y p]
7529  AOT_show x([F]x  p)
7530    by (rule "rule=E"[rotated, OF 0[symmetric]]; rule RN; rule GEN; rule "beta-C-meta"[THEN "→E"])
7531      "cqt:2[lambda]"
7532qed
7533
7534AOT_theorem "prop-prop2:4": Propositional([F])  Propositional([F])
7535proof(rule "→I")
7536  AOT_assume Propositional([F])
7537  AOT_hence p(F = y p]) using "≡dfE"[OF "prop-prop1"] by blast
7538  then AOT_obtain p where F = y p] using "∃E"[rotated] by blast
7539  AOT_hence (F = y p]) using "id-nec:2" "modus-tollens:1" "raa-cor:3" by blast
7540  AOT_hence p (F = y p]) using "∃I" by fast
7541  AOT_hence 0: p (F = y p]) by (metis Buridan "vdash-properties:10")
7542  AOT_thus Propositional([F])
7543    using "prop-prop1"[THEN "≡Df"]
7544    by (AOT_subst Propositional([F]) p (F = y p])) auto
7545qed
7546
7547AOT_define indicriminate :: ‹Π  φ› ("Indiscriminate'(_')")
7548  "prop-indis": Indiscriminate([F]) df F & (x [F]x  x [F]x)
7549
7550AOT_theorem "prop-in-thm": Propositional([Π])  Indiscriminate([Π])
7551proof(rule "→I")
7552  AOT_assume Propositional([Π])
7553  AOT_hence p Π = y p] using "≡dfE"[OF "prop-prop1"] by blast
7554  then AOT_obtain p where Π_def: Π = y p] using "∃E"[rotated] by blast
7555  AOT_show Indiscriminate([Π])
7556  proof (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7557    AOT_show Π
7558      using Π_def by (meson "t=t-proper:1" "vdash-properties:6")
7559  next
7560    AOT_show (x [Π]x  x [Π]x)
7561    proof (rule "rule=E"[rotated, OF Π_def[symmetric]]; rule RN; rule "→I"; rule GEN)
7562      AOT_modally_strict {
7563        AOT_assume x y p]x
7564        then AOT_obtain a where y p]a using "∃E"[rotated] by blast
7565        AOT_hence 0: p by (metis "β→C"(1))
7566        AOT_show y p]x for x
7567          apply (rule "β←C"(1))
7568            apply "cqt:2[lambda]"
7569           apply (fact "cqt:2[const_var]"[axiom_inst])
7570          by (fact 0)
7571      }
7572    qed
7573  qed
7574qed
7575
7576AOT_theorem "prop-in-f:1": Necessary([F])  Indiscriminate([F])
7577proof (rule "→I")
7578  AOT_assume Necessary([F])
7579  AOT_hence 0: x1...∀xn [F]x1...xn using "≡dfE"[OF "contingent-properties:1"] by blast
7580  AOT_show Indiscriminate([F])
7581    by (rule "≡dfI"[OF "prop-indis"])
7582       (metis "0" "KBasic:1" "&I" "ex:1:a" "rule-ui:2[const_var]" "vdash-properties:6") 
7583qed
7584
7585AOT_theorem "prop-in-f:2": Impossible([F])  Indiscriminate([F])
7586proof (rule "→I")
7587  AOT_modally_strict {
7588    AOT_have x ¬[F]x  (x [F]x  x [F]x)
7589      by (metis "instantiation" "cqt-orig:3" "Hypothetical Syllogism" "deduction-theorem" "raa-cor:3")
7590  }
7591  AOT_hence 0: x ¬[F]x  (x [F]x  x [F]x)
7592    by (rule "RM:1")
7593  AOT_assume Impossible([F])
7594  AOT_hence x ¬[F]x using "≡dfE"[OF "contingent-properties:2"] "&E" by blast
7595  AOT_hence 1: (x [F]x  x [F]x) using 0 "→E" by blast
7596  AOT_show Indiscriminate([F])
7597    by (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7598       (simp add: "ex:1:a" "rule-ui:2[const_var]" 1)+
7599qed
7600
7601AOT_theorem "prop-in-f:3:a": ¬Indiscriminate([E!])
7602proof(rule "raa-cor:2")
7603  AOT_assume Indiscriminate([E!])
7604  AOT_hence 0: (x [E!]x  x [E!]x)
7605    using "≡dfE"[OF "prop-indis"] "&E" by blast
7606  AOT_hence x [E!]x  x [E!]x
7607    using "KBasic:13" "vdash-properties:10" by blast
7608  moreover AOT_have x [E!]x
7609    by (simp add: "thm-cont-e:3")
7610  ultimately AOT_have x [E!]x
7611    by (metis "vdash-properties:6")
7612  AOT_thus p & ¬p for p
7613    by (metis "≡dfE" "conventions:5" "o-objects-exist:5" "reductio-aa:1")
7614qed
7615
7616AOT_theorem "prop-in-f:3:b": ¬Indiscriminate([E!]-)
7617proof (rule "rule=E"[rotated, OF "rel-neg-T:2"[symmetric]]; rule "raa-cor:2")
7618  AOT_assume Indiscriminate(x ¬[E!]x])
7619  AOT_hence 0: (x x ¬[E!]x]x  x x ¬[E!]x]x)
7620    using "≡dfE"[OF "prop-indis"] "&E" by blast
7621  AOT_hence x x ¬[E!]x]x  x x ¬[E!]x]x
7622    using "→E" "qml:1" "vdash-properties:1[2]" by blast
7623  moreover AOT_have x x ¬[E!]x]x
7624    apply (AOT_subst x ¬E!x]x ¬E!x bound: x)
7625    apply (rule "beta-C-meta"[THEN "→E"])
7626     apply "cqt:2[lambda]"
7627    by (metis (full_types) "B◇" RN "T◇" "cqt-further:2" "o-objects-exist:5" "vdash-properties:10")
7628  ultimately AOT_have 1: x x ¬[E!]x]x
7629    by (metis "vdash-properties:6")
7630  AOT_hence x ¬[E!]x
7631    by (AOT_subst (reverse) ¬[E!]x  x ¬[E!]x]x bound: x)
7632       (auto intro!: "cqt:2" "beta-C-meta"[THEN "→E"])
7633  AOT_hence x ¬[E!]x by (metis "CBF" "vdash-properties:10")
7634  moreover AOT_obtain a where abs_a: O!a
7635    using "instantiation" "o-objects-exist:1" "qml:2" "vdash-properties:1[2]" "vdash-properties:6" by blast
7636  ultimately AOT_have ¬[E!]a using "∀E" by blast
7637  AOT_hence 2: ¬[E!]a by (metis "≡dfE" "conventions:5" "reductio-aa:1")
7638  AOT_have A!a
7639    apply (rule "=dfI"(2)[OF AOT_abstract])
7640     apply "cqt:2[lambda]"
7641    apply (rule "β←C"(1))
7642      apply "cqt:2[lambda]"
7643    using "cqt:2[const_var]"[axiom_inst] apply blast
7644    by (fact 2)
7645  AOT_thus p & ¬p for p using abs_a
7646    by (metis "≡E"(1) "oa-contingent:2" "reductio-aa:1")
7647qed
7648
7649AOT_theorem "prop-in-f:3:c": ¬Indiscriminate(O!)
7650proof(rule "raa-cor:2")
7651  AOT_assume Indiscriminate(O!)
7652  AOT_hence 0: (x O!x  x O!x)
7653    using "≡dfE"[OF "prop-indis"] "&E" by blast
7654  AOT_hence x O!x  x O!x
7655    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7656  moreover AOT_have x O!x
7657    using "o-objects-exist:1" by blast
7658  ultimately AOT_have x O!x
7659    by (metis "vdash-properties:6")
7660  AOT_thus p & ¬p for p
7661    by (metis "o-objects-exist:3" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7662qed
7663
7664AOT_theorem "prop-in-f:3:d": ¬Indiscriminate(A!)
7665proof(rule "raa-cor:2")
7666  AOT_assume Indiscriminate(A!)
7667  AOT_hence 0: (x A!x  x A!x)
7668    using "≡dfE"[OF "prop-indis"] "&E" by blast
7669  AOT_hence x A!x  x A!x
7670    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7671  moreover AOT_have x A!x
7672    using "o-objects-exist:2" by blast
7673  ultimately AOT_have x A!x
7674    by (metis "vdash-properties:6")
7675  AOT_thus p & ¬p for p
7676    by (metis "o-objects-exist:4" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7677qed
7678
7679AOT_theorem "prop-in-f:4:a": ¬Propositional(E!)
7680  using "modus-tollens:1" "prop-in-f:3:a" "prop-in-thm" by blast
7681
7682AOT_theorem "prop-in-f:4:b": ¬Propositional(E!-)
7683  using "modus-tollens:1" "prop-in-f:3:b" "prop-in-thm" by blast
7684
7685AOT_theorem "prop-in-f:4:c": ¬Propositional(O!)
7686  using "modus-tollens:1" "prop-in-f:3:c" "prop-in-thm" by blast
7687
7688AOT_theorem "prop-in-f:4:d": ¬Propositional(A!)
7689  using "modus-tollens:1" "prop-in-f:3:d" "prop-in-thm" by blast
7690
7691AOT_theorem "prop-prop-nec:1": p (F = y p])  p(F = y p])
7692proof(rule "→I")
7693  AOT_assume p (F = y p])
7694  AOT_hence p (F = y p])
7695    by (metis "BF◇" "vdash-properties:10")
7696  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7697  AOT_hence F = y p] by (metis "derived-S5-rules:2" emptyE "id-nec:2" "vdash-properties:6")
7698  AOT_thus p(F = y p]) by (rule "∃I")
7699qed
7700
7701AOT_theorem "prop-prop-nec:2": p (F  y p])  p(F  y p])
7702proof(rule "→I")
7703  AOT_assume p (F  y p])
7704  AOT_hence (F  y p]) for p
7705    using "∀E" by blast
7706  AOT_hence (F  y p]) for p
7707    by (rule "id-nec2:2"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7708  AOT_hence p (F  y p]) by (rule GEN)
7709  AOT_thus p (F  y p]) using BF[THEN "→E"] by fast
7710qed
7711
7712AOT_theorem "prop-prop-nec:3": p (F = y p])  p(F = y p])
7713proof(rule "→I")
7714  AOT_assume p (F = y p])
7715  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7716  AOT_hence (F = y p]) by (metis "id-nec:2" "vdash-properties:6")
7717  AOT_hence p(F = y p]) by (rule "∃I")
7718  AOT_thus p(F = y p]) by (metis Buridan "vdash-properties:10")
7719qed
7720
7721AOT_theorem "prop-prop-nec:4": p (F  y p])  p(F  y p])
7722proof(rule "→I")
7723  AOT_assume p (F  y p])
7724  AOT_hence p (F  y p]) by (metis "Buridan◇" "vdash-properties:10")
7725  AOT_hence (F  y p]) for p
7726    using "∀E" by blast
7727  AOT_hence F  y p] for p
7728    by (rule "id-nec2:3"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7729  AOT_thus p (F  y p]) by (rule GEN)
7730qed
7731
7732AOT_theorem "enc-prop-nec:1": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7733proof(rule "→I"; rule GEN; rule "→I")
7734  fix F
7735  AOT_assume F (x[F]  p(F = y p]))
7736  AOT_hence F (x[F]  p(F = y p]))
7737    using "Buridan◇" "vdash-properties:10" by blast
7738  AOT_hence 0: (x[F]  p(F = y p])) using "∀E" by blast
7739  AOT_assume x[F]
7740  AOT_hence x[F] by (metis "en-eq:2[1]" "≡E"(1))
7741  AOT_hence p(F = y p])
7742    using 0 by (metis "KBasic2:4" "≡E"(1) "vdash-properties:10")
7743  AOT_thus p(F = y p])
7744    using "prop-prop-nec:1"[THEN "→E"] by blast
7745qed
7746
7747AOT_theorem "enc-prop-nec:2": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7748  using "derived-S5-rules:1"[where Γ="{}", simplified, OF "enc-prop-nec:1"]
7749  by blast
7750
7751(*<*)
7752end
7753(*>*)